Skip to content

Commit c976147

Browse files
Add section about whitelisting for maintenance
1 parent 9b3fc98 commit c976147

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,31 @@ composer require stackkit/laravel-google-cloud-scheduler
5050
STACKKIT_CLOUD_SCHEDULER_APP_URL=https://yourdomainname.com/cloud-scheduler-job
5151
```
5252

53+
(3) Optional: whitelist route for maintenance mode
54+
55+
This step is optional, but highly recommended. To allow jobs to keep running if the application is down (`php artisan down`) you must modify the `PreventRequestsDuringMaintenance` middleware:
56+
57+
```diff
58+
<?php
59+
60+
namespace App\Http\Middleware;
61+
62+
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
63+
64+
class PreventRequestsDuringMaintenance extends Middleware
65+
{
66+
/**
67+
* The URIs that should be reachable while maintenance mode is enabled.
68+
*
69+
* @var array
70+
*/
71+
protected $except = [
72+
+ '/cloud-scheduler-job',
73+
];
74+
}
75+
76+
```
77+
5378
# Cloud Scheduler Example
5479

5580
Here is an example job that will run `php artisan schedule:run` every minute.

0 commit comments

Comments
 (0)