From 7a658b7bfa14e5367ff355de8e887ecb593e0703 Mon Sep 17 00:00:00 2001 From: Chris Mancuso Date: Tue, 30 Mar 2021 11:36:30 +0000 Subject: [PATCH] schedule monitor config --- config/schedule-monitor.php | 44 ++++++++++++++++ ..._113519_create_schedule_monitor_tables.php | 50 +++++++++++++++++++ found | 0 3 files changed, 94 insertions(+) create mode 100644 config/schedule-monitor.php create mode 100644 database/migrations/2021_03_30_113519_create_schedule_monitor_tables.php create mode 100644 found diff --git a/config/schedule-monitor.php b/config/schedule-monitor.php new file mode 100644 index 000000000..8b4852219 --- /dev/null +++ b/config/schedule-monitor.php @@ -0,0 +1,44 @@ + 30, + + /* + * The date format used for all dates displayed on the output of commands + * provided by this package. + */ + 'date_format' => 'Y-m-d H:i:s', + + /* + * Oh Dear can notify you via Mail, Slack, SMS, web hooks, ... when a + * scheduled task does not run on time. + * + * More info: https://ohdear.app/cron-checks + */ + 'oh_dear' => [ + /* + * You can generate an API token at the Oh Dear user settings screen + * + * https://ohdear.app/user-settings/api + */ + 'api_token' => env('OH_DEAR_API_TOKEN', ''), + + /* + * The id of the site you want to sync the schedule with. + * + * You'll find this id on the settings page of a site at Oh Dear. + */ + 'site_id' => env('OH_DEAR_SITE_ID'), + + /* + * To keep scheduled jobs as short as possible, Oh Dear will be pinged + * via a queued job. Here you can specify the name of the queue you wish to use. + */ + 'queue' => env('OH_DEAR_QUEUE'), + ], +]; diff --git a/database/migrations/2021_03_30_113519_create_schedule_monitor_tables.php b/database/migrations/2021_03_30_113519_create_schedule_monitor_tables.php new file mode 100644 index 000000000..4cbe4da13 --- /dev/null +++ b/database/migrations/2021_03_30_113519_create_schedule_monitor_tables.php @@ -0,0 +1,50 @@ +bigIncrements('id'); + + $table->string('name'); + $table->string('type')->nullable(); + $table->string('cron_expression'); + $table->string('timezone')->nullable(); + $table->string('ping_url')->nullable(); + + $table->dateTime('last_started_at')->nullable(); + $table->dateTime('last_finished_at')->nullable(); + $table->dateTime('last_failed_at')->nullable(); + $table->dateTime('last_skipped_at')->nullable(); + + $table->dateTime('registered_on_oh_dear_at')->nullable(); + $table->dateTime('last_pinged_at')->nullable(); + $table->integer('grace_time_in_minutes'); + + $table->timestamps(); + }); + + + Schema::create('monitored_scheduled_task_log_items', function (Blueprint $table) { + $table->bigIncrements('id'); + + $table->unsignedBigInteger('monitored_scheduled_task_id'); + $table + ->foreign('monitored_scheduled_task_id', 'fk_scheduled_task_id') + ->references('id') + ->on('monitored_scheduled_tasks') + ->cascadeOnDelete(); + + $table->string('type'); + + $table->json('meta')->nullable(); + + $table->timestamps(); + }); + } +} diff --git a/found b/found new file mode 100644 index 000000000..e69de29bb