Queue plugin for CakePHP - simple, pure PHP and without dependencies.
MIT License
Published by dereuromark about 5 years ago
You can now use HTML5 progress bar (easier to style using CSS).
For this it is recommended to add the textual one from above as fallback, though:
$textProgressBar = $this->QueueProgress->progressBar($queuedJob, 18);
echo $this->QueueProgress->htmlProgressBar($queuedJob, $textProgressBar);
The textual bar will only be visible for older browsers that do not support the HTML5 tag.
The same goes for the timeout progress bars.
$textTimeoutProgressBar = $this->QueueProgress->timeoutProgressBar($queuedJob, 18);
echo $this->QueueProgress->htmlTimeoutProgressBar($queuedJob, $textTimeoutProgressBar);
For details see docs.
Fixed PostgreSQL support for requestJob()
.
Travis is now fully active and passing for this DB type.
Published by dereuromark about 5 years ago
Fixed progress display.
Published by dereuromark about 5 years ago
This is a BC breaking major for use with CakePHP 3.7+.
Please see Wiki for version map.
Published by dereuromark over 5 years ago
This is a BC breaking major
Please see Wiki for version map.
Published by dereuromark over 5 years ago
Published by dereuromark over 5 years ago
Published by dereuromark over 5 years ago
Using Queue.multiserver config you can now have the correct behavior per environment from both CLI and web backend.
Added a re-run option for successfully run jobs on CLI
Just execute
bin/cake queue rerun MyTask {reference}
The optional reference can be an additional filter for specific jobs of this task.
Please note:
The API for reset() has slightly changed, but usually no one is directly using the result here.
It now returns the changed/touched rows (int) instead of boolean success.
Published by dereuromark over 5 years ago
Published by dereuromark over 5 years ago
Added maxworkers
config to set the max amount of workers per server. If not set or 0 it will behave as before, but with this > 0 it will assert that a cronjob cannot start more workers than currently running. It includes workers that died improperly to ensure this cannot bypass bottleneck situations where workers got marked as "to be stopped" but are still running some background script for minutes more.
Based on your memory and the jobs you are running you can estimate how many workers in parallel are the maximum you want to allow. This helps to prevent "Fatal error: Out of Memory" situations or other long-running jobs in parallel overloading your server (load >> 1).
It is now easier to export failed jobs and import them locally to re-run there for debugging.
You can import them as-is, or auto-resetted.
Published by dereuromark almost 6 years ago
Published by dereuromark almost 6 years ago
You can now run multiple worker servers:
env('SERVER_NAME')
or gethostname()
return a unique name per server instance.bin/cake queue end
in the deployment script by shutting down active workers early. Either all (bin/cake queue end -q
), or by server instance (bin/cake queue end server -q
).To migrate make sure you execute this once all workers have been terminated (no active processes):
bin/cake migrations migrate -p Queue
Published by dereuromark almost 6 years ago
Published by dereuromark almost 6 years ago
Queue.configLoaded
is found.queue settings
command to display currently running jobs.Published by dereuromark almost 6 years ago
isStatisticEnabled
config.Published by dereuromark almost 6 years ago
Published by dereuromark about 6 years ago
Published by dereuromark about 6 years ago
Make sure that if a process gets stuck, e.g. in some exec() forever running code, that the crontab doesnt built up too many never-ending workers running and then killing the server.
Default: 120s*100 = 3.3h
So if you spawn new runners every 5 minutes via crontab cronjob setting, you get a total process count of 40 as the worse case scenario.
Via workertimeout config it can be manually adjusted to a custom value.
Make sure you adjust it to the longest possible running job * x seconds at least.
The previous 0 (forever) timeout on runners is not a recommended setting anymore.
Published by dereuromark over 6 years ago
Allow filtering per type and group also with multiple values (comma separated). Allow also excluding using -
prefix.
Published by dereuromark over 6 years ago
Queue.isSearchEnabled
Configure key. Otherwise auto-detect based on friendsofcake/search plugin being loaded decides this.Published by dereuromark over 6 years ago