You can easily add your own jobs. Just create a new service inside your application.
The service must implement the
run method must return an implementation of the StatusInterface
(some default provided in the bundle, but you could use your own implementations).
The business logic used inside the job is totally up to you!
- has the sitemap.xml been regenerated in the last 24 hours?
- is the "failed" queue for Symfony Messenger increasing at an alarming speed?
- check if the number of critical errors in the application log during the last X minutes is higher than Y
- is a long-running script taking an unusually long time?
Your service must be public, and must be tagged as
All tagged services will be injected into the listing class, from then on you can activate the job by using the console commands.
MonitoringManagerBundle\Service\Jobs\CoffeeMaker: tags: [ 'monitoring_manager.job' ] public: true