<commit_before>#Queue

Simple job queue package for Laravel 5

Configure via `config/app.php`:  
Add to $providers: `NZTim\Queue\QueueServiceProvider::class`  
Add to $aliases: `'QueueMgr' => NZTim\Queue\QueueMgrFacade::class,`  

`php artisan queuemgr:migration` to add migration file
`php artisan migrate` to run it

Optional `.env` settings:  
 - `QUEUEMGR_ATTEMPTS` sets the default number of attempts for a job

###Jobs

Job classes must implement `NZTim\Queue\Job` interface, which consists solely of a `handle()` method.

###Usage

`php artisan queuemgr:process` runs all the jobs in the queue.  Job failures will be logged as warnings, and final failures as errors.  
`php artisan queuemgr:failed` lists all failed jobs.  
`php artisan queuemgr:clear` clears failed jobs from the queue.  

All jobs are soft-deleted initially and purged after 1 month.

The Laravel scheduler is recommended because it offers the ability to run the command often but without overlapping:    
`$schedule->command('queuemgr:process')->withoutOverlapping()->everyMinute();`  or  
`$schedule->command('queuemgr:process')->withoutOverlapping()->cron('*/2 * * * *');;`   

Alternatively, set your cron to run `queuemgr:process` at your preferred interval.   
If you process the queue frequently and the processes are slow, it's possible to duplicate a job, so the Laravel scheduler is recommended. 

### Monitoring

If there is a server problem and the mutex file used by `withoutOverlapping()` is not cleared, the process command may not be able to run successfully.
Scheduling `php artisan queuemgr:check` will review all unprocessed jobs and log an error if the age is older than 1 hour.

`$schedule->command('queuemgr:check')->everyHour();`

Do not use `withoutOverlapping()` with this command to avoid the same problem occurring.
Configure the maximum age (in hours) by setting the `.env` value `QUEUEMGR_MAX_AGE`.<commit_msg>Fix syntax<commit_after>#Queue

Simple job queue package for Laravel 5

Configure via `config/app.php`:  
Add to $providers: `NZTim\Queue\QueueServiceProvider::class`  
Add to $aliases: `'QueueMgr' => NZTim\Queue\QueueMgrFacade::class,`  

`php artisan queuemgr:migration` to add migration file
`php artisan migrate` to run it

Optional `.env` settings:  
 - `QUEUEMGR_ATTEMPTS` sets the default number of attempts for a job

###Jobs

Job classes must implement `NZTim\Queue\Job` interface, which consists solely of a `handle()` method.

###Usage

`php artisan queuemgr:process` runs all the jobs in the queue.  Job failures will be logged as warnings, and final failures as errors.  
`php artisan queuemgr:failed` lists all failed jobs.  
`php artisan queuemgr:clear` clears failed jobs from the queue.  

All jobs are soft-deleted initially and purged after 1 month.

The Laravel scheduler is recommended because it offers the ability to run the command often but without overlapping:    
`$schedule->command('queuemgr:process')->withoutOverlapping()->everyMinute();`  or  
`$schedule->command('queuemgr:process')->withoutOverlapping()->cron('*/2 * * * *');;`   

Alternatively, set your cron to run `queuemgr:process` at your preferred interval.   
If you process the queue frequently and the processes are slow, it's possible to duplicate a job, so the Laravel scheduler is recommended. 

### Monitoring

If there is a server problem and the mutex file used by `withoutOverlapping()` is not cleared, the process command may not be able to run successfully.
Scheduling `php artisan queuemgr:check` will review all unprocessed jobs and log an error if the age is older than 1 hour.

`$schedule->command('queuemgr:check')->hourly();`

Do not use `withoutOverlapping()` with this command to avoid the same problem occurring.
Configure the maximum age (in hours) by setting the `.env` value `QUEUEMGR_MAX_AGE`.
{'fraction_non_alphanumeric': 0.0899581589958159, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 4.921052631578948, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3451034', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1098, 'n_words': 476}