Last active
January 21, 2024 22:57
-
-
Save mmouih/33d28670193572594aac8e347ab78eae to your computer and use it in GitHub Desktop.
WatchDog to monitor services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Scheduler; | |
use App\Message\WatchDogMessage; | |
use Symfony\Component\Scheduler\Schedule; | |
use Symfony\Component\Scheduler\RecurringMessage; | |
use Symfony\Component\Scheduler\Attribute\AsSchedule; | |
use Symfony\Component\Scheduler\ScheduleProviderInterface; | |
#[AsSchedule('watchdog')] | |
class WatchDogScheduleProvider implements ScheduleProviderInterface | |
{ | |
public function getSchedule(): Schedule | |
{ | |
return (new Schedule())->add( | |
RecurringMessage::every('5 seconds', new WatchDogMessage(['logger', 'imports', 'exports'])) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment