jonassiewertsen/statamic-jobs

Fund package maintenance!
jonassiewertsen

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 1

Open Issues: 0

Type:statamic-addon

v1.0.0-beta.3 2021-11-14 19:09 UTC

This package is auto-updated.

Last update: 2021-11-14 19:12:33 UTC


README

Statamic 3.1+ Latest Version on Packagist

Laravel does handle failed jobs by default, but does need a database. What if your Statamic setup does not have or need a database?

Well ... failing jobs can not be handled!

This addon does provide a simple solution for small Statamic setups: A failing job will be saved as flat file in the storage.

NOT PRODUCTION READY YET Be aware, that this is an early version, which shouldn't be used on any production server yet.

Installation

1. Require the package

composer require jonassiewertsen/statamic-jobs

2. Configure the Failed Queue Jobs Driver

// config/queue.php

    'failed' => [
        'driver' => env('QUEUE_FAILED_DRIVER', 'file'),
        // 'storage_path' => storage_path('failed-jobs'), 
    ],
    
    // INSTEAD of fx
    // 'failed' => [
    //     'driver' => env('QUEUE_FAILED_DRIVER', 'statamic'),
    //     'database' => env('DB_CONNECTION', 'mysql'),
    //     'table' => 'failed_jobs',
    // ],

Usage

You can access your failed jobs via the default artisan commands. Fx.:

php artisan queue:failed <- list all failed jobs

php artisan queue:retry JOB_UUID_ID <- Retry a given job

php artisan queue:flush <- Flush all failed jobs

Requirements

  • PHP 8.0
  • Laravel 8
  • Statamic >= 3.1

Support

I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

Sponsor me on GitHub to support my work and the support for this addon.

License

This plugin is published under the MIT license. Feel free to use it and remember to spread love.