Skip to content

Commit 06d3d91

Browse files
committed
Oh Dear scheduled tasks
1 parent d153c7c commit 06d3d91

File tree

4 files changed

+236
-1
lines changed

4 files changed

+236
-1
lines changed

app/Console/Kernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Kernel extends ConsoleKernel
2020
*/
2121
protected function schedule(Schedule $schedule)
2222
{
23+
$schedule->command('schedule-monitor:sync')->dailyAt('04:56');
24+
$schedule->command('schedule-monitor:clean')->daily();
2325
$schedule->command('backup:clean')->daily()->at('01:00');
2426
$schedule->command('backup:run')->daily()->at('02:00');
2527
$schedule->command('horizon:snapshot')->everyFiveMinutes();

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
"league/commonmark": "^1.0",
2727
"league/flysystem-aws-s3-v3": "^1.0",
2828
"livewire/livewire": "^1.0",
29+
"ohdearapp/ohdear-php-sdk": "^3.0",
2930
"predis/predis": "^1.1",
3031
"ramsey/uuid": "^4.1",
3132
"roave/security-advisories": "dev-master",
3233
"spatie/laravel-backup": "^6.11",
3334
"spatie/laravel-feed": "^2.6",
3435
"spatie/laravel-robots-middleware": "^1.2",
36+
"spatie/laravel-schedule-monitor": "^2.0",
3537
"yarri/link-finder": "^2.5"
3638
},
3739
"require-dev": {

composer.lock

Lines changed: 182 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class CreateScheduleMonitorTables extends Migration
8+
{
9+
public function up()
10+
{
11+
Schema::create('monitored_scheduled_tasks', function (Blueprint $table) {
12+
$table->bigIncrements('id');
13+
14+
$table->string('name');
15+
$table->string('type')->nullable();
16+
$table->string('cron_expression');
17+
$table->string('timezone')->nullable();
18+
$table->string('ping_url')->nullable();
19+
20+
$table->dateTime('last_started_at')->nullable();
21+
$table->dateTime('last_finished_at')->nullable();
22+
$table->dateTime('last_failed_at')->nullable();
23+
$table->dateTime('last_skipped_at')->nullable();
24+
25+
$table->dateTime('registered_on_oh_dear_at')->nullable();
26+
$table->dateTime('last_pinged_at')->nullable();
27+
$table->integer('grace_time_in_minutes');
28+
29+
$table->timestamps();
30+
});
31+
32+
33+
Schema::create('monitored_scheduled_task_log_items', function (Blueprint $table) {
34+
$table->bigIncrements('id');
35+
36+
$table->unsignedBigInteger('monitored_scheduled_task_id');
37+
$table
38+
->foreign('monitored_scheduled_task_id', 'fk_scheduled_task_id')
39+
->references('id')
40+
->on('monitored_scheduled_tasks')
41+
->cascadeOnDelete();
42+
43+
$table->string('type');
44+
45+
$table->json('meta')->nullable();
46+
47+
$table->timestamps();
48+
});
49+
}
50+
}

0 commit comments

Comments
 (0)