schedule monitor config

This commit is contained in:
2021-03-30 11:36:30 +00:00
parent 4667b31dd8
commit 7a658b7bfa
3 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
return [
/*
* The schedule monitor will log each start, finish and failure of all scheduled jobs.
* After a while the `monitored_scheduled_task_log_items` might become big.
* Here you can specify the amount of days log items should be kept.
*/
'delete_log_items_older_than_days' => 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'),
],
];

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateScheduleMonitorTables extends Migration
{
public function up()
{
Schema::create('monitored_scheduled_tasks', function (Blueprint $table) {
$table->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();
});
}
}

0
found Normal file
View File