Get notified when stuck jobs are detected.

Overview

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
^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.

You might also like...
This project is based on the aggregation of jobs from some technology companies.

FIND-JOBS-ALERT 💼 🔎 📧 This project is based on the aggregation of jobs from some technology companies. Check below, some companies avaliable in pro

A Laravel package to monitor the status and history of jobs on the queue.

Monitored Jobs for Laravel Overview This package tracks the status and history of your queued jobs by hooking into the events that Laravel fires for i

A site which you can apply jobs or search for employees with cool functionalities..
A site which you can apply jobs or search for employees with cool functionalities..

About App An App which you can apply jobs or search for employees with cool functionalities. Some Pics of App Click Image to Zoom in Sign In & Up Empl

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel
Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!

Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs) in PHP using a fluent API.

Crunz Install a cron job once and for all, manage the rest from the code. Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs)

Cron jobs scheduler for Spiral Framework

This is a cron jobs scheduler that can be easily integrated with your project based on spiral framework. The idea was originally inspired by the Laravel Task Scheduling.

A Gitlab API wrapper that helps to automate common actions on CI jobs

Gitlab CI client This is a Gitlab API wrapper that helps to automate common actions on CI jobs (eg: Open a merge request, Open or close an issue etc)

An alternative to run cron jobs that uses simple HTTP requests

SilverStripe Simple Jobs An alternative to run cron jobs that uses simple HTTP requests. This module require SilverStripe CronTask. Why? Configuring c

Kirby 3 Plugin for running jobs like cleaning the cache from within the Panel, PHP code, CLI or a cronjob

Kirby 3 Janitor Kirby 3 Plugin for running jobs. It is a Panel Button! It has jobs build-in for cleaning the cache, sessions, create zip-backup, pre-g

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:

Latest Salt Documentation Open an issue (bug report, feature request, etc.) Salt is the world’s fastest, most intelligent and scalable automation engi

Get info from any web service or page

Embed PHP library to get information from any web page (using oembed, opengraph, twitter-cards, scrapping the html, etc). It's compatible with any web

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

PHP IMAP Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNT

Get started with Laravel 5.3 and AngularJS (material)
Get started with Laravel 5.3 and AngularJS (material)

Laravel 5.3 Angular Material Starter Demo An online demo is available. Angular (2+) update While this starter used to be an excellent starting point f

Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery

Mobile App Version Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery. Installation Add to co

Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.
Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.

WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure

get nearby location by coordinate from eloquent laravel

LARAVEL-COORDINATE get nearby location data from database with eloquent laravel Installation composer require bagusindrayana/laravel-coordinate In M

This plugin lets you to get spawners that when you break them they regenerates themselves!

ItemSpawners This plugin lets you to get spawners that when you break them they regenerates themselves! How to use? For any information: https://githu

Collection of the Laravel/Eloquent Model classes that allows you to get data directly from a Magento 2 database.

Laragento LAravel MAgento Micro services Magento 2 has legacy code based on abandoned Zend Framework 1 with really ugly ORM on top of outdated Zend_DB

PHP CLI project to get an appointment from https://vacunacovid.catsalut.gencat.ca

covid_vaccine_bcn PHP CLI project to get an appointment from https://citavacunacovid19.catsalut.gencat.cat/Vacunacio_Covid/Vacunacio/VacunacioCovidRes

Comments
  • 3.0.0

    3.0.0

    • Changed the name of the package.
    • Changed the command signature.
    • Changed configuration file name and structure.
    • Changed some class and exception names.
    • Dropped support for PHP versions under 7.4.
    • Dropped support for Laravel versions under 6.0.
    opened by Okipa 0
  • 3.0.0

    3.0.0

    • Changed the name of the package.
    • Changed the command signature.
    • Changed configuration file name and structure.
    • Changed some class and exception names.
    • Dropped support for PHP versions under 7.4.
    • Dropped support for Laravel versions under 6.0.
    opened by Okipa 0
Releases(2.3.0)
Owner
Arthur LORENT
Dev department director @ACID-Solutions. Crafts Web apps and packages with @laravel. Builds mobile apps with @expo. Drummer.
Arthur LORENT
Get notified when a queued job fails

Get notified when a queued job fails This package sends notifications if a queued job fails. Out of the box it can send a notification via mail and/or

Spatie 748 Dec 16, 2022
Schedule your OLX searches and get notified by email when something new is published 📆

Olx.ba search scheduler Missing scheduler for Olx.ba searches. Production-ready small web application which notifies you by email when something new i

Benjamin Fajić 8 Nov 8, 2022
Bernard is a multi-backend PHP library for creating background jobs for later processing.

Bernard makes it super easy and enjoyable to do background processing in PHP. It does this by utilizing queues and long running processes. It supports

Bernard 1.2k Jan 2, 2023
Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.

Jobby, a PHP cron job manager Install the master jobby cron job, and it will manage all your offline tasks. Add jobs without modifying crontab. Jobby

null 1k Dec 25, 2022
Dispatch Laravel jobs via Artisan

This package can register jobs as Artisan commands. All you need to do is let your job implement the empty ArtisanDispatchable interface.

Spatie 135 Nov 7, 2022
Add variables to the payload of all jobs in a Laravel app

Inject extra info to the payloads of all jobs in a Laravel app This package makes it easy to inject things in every job. Imagine that you want to have

Spatie 62 Dec 9, 2022
This package allows you to easily track your laravel jobs!

Trackable Jobs For Laravel This package allows you to track your laravel jobs! Using this package, you can easily persist the output and the status of

Mateus Junges 220 Dec 25, 2022
Chain Laravel jobs without having to glue it to a starting job

Laravel Job Chainer JobChainer does chain a variable amount of jobs by adding them with the add() method. This makes it possible to chain jobs without

Just Iversen 69 Nov 18, 2022
Schedule and unschedule eloquent models elegantly without cron jobs

Laravel Schedulable Schedule and Unschedule any eloquent model elegantly without cron job. Salient Features: Turn any Eloquent Model into a schedulabl

Neelkanth Kaushik 103 Dec 7, 2022
This repository contains the codebase PHP bridge using RoadRunner Jobs plugin.

RoadRunner Jobs Plugin This repository contains the codebase PHP bridge using RoadRunner Jobs plugin. Installation To install application server and J

Spiral Scout 15 Nov 9, 2022