Giter VIP home page Giter VIP logo

laravel-stuck-jobs-notifier's Introduction

Laravel Stuck Jobs Notifier

Latest Stable Version Total Downloads Build Status Coverage Status License: MIT

Get notified and execute PHP callback when you have stuck jobs for a defined number of hours.

Notifications can be sent by mail, Slack and webhooks (chats often provide a webhook API).

Found this package helpful? Please consider supporting my work!

Donate Donate

Compatibility

Laravel version PHP version Package version
^9.0 | ^10.0 8.1.* | 8.2.* ^2.4
^8.0 | ^9.0 ^8.1 | ^8.2 ^2.3
^8.0 | ^9.0 ^8.0 | ^8.1 ^2.2
^7.0 | ^8.0 ^7.4 | ^8.0 ^2.1
^7.0 | ^8.0 ^7.4 ^2.0
^6.0 | ^7.0 ^7.4 ^1.0

Upgrade guide

Table of Contents

Installation

Install the package with composer:

composer require okipa/laravel-stuck-jobs-notifier

If you intend to send Slack notifications you will have to install:

composer require laravel/slack-notification-channel

If you intend to send webhook notifications you will have to install:

composer require laravel-notification-channels/webhook

Configuration

Publish the package configuration:

php artisan vendor:publish --tag=stuck-jobs-notifier:config

Translations

All words and sentences used in this package are translatable.

See how to translate them on the Laravel official documentation: https://laravel.com/docs/localization#using-translation-strings-as-keys.

Here is the list of the words and sentences available for translation by default:

* {1}[:app - :env] :count job is stuck in queue|[2,*][:app - :env] :count jobs are stuck in queue
* {1}We have detected that :count job is stuck in the [:app - :env](:url) queue since the :day at :hour.|[2,*]We have detected that :count jobs are stuck in the [:app - :env](:url) queue since the :day at :hour.
* Please check your stuck jobs connecting to your server and executing the "php artisan queue:failed" command.
* {1}`[:app - :env]` :count job is stuck in the :url queue since the :day at :hour.|[2,*]`[:app - :env]` :count jobs are stuck in the :url queue since the :day at :hour.
* {1}:count job is stuck in queue since the :day at :hour.|[2,*]:count jobs are stuck in queue since the :day at :hour.
* Notification test:
* Exception test:

Usage

Just add this command in the schedule() method of your \App\Console\Kernel class:

$schedule->command('queue:stuck:notify')->twiceDaily(10, 16);

And you will be notified as soon as some jobs will be stuck in the failed_jobs table for the number of days you configured.

Once everything has been set up, you can check if the configuration is correct by simulating stuck jobs detection:

php artisan queue:stuck:simulate

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-stuck-jobs-notifier's People

Contributors

okipa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.