Closed angrybrad closed 4 years ago
Your UI can also manually trigger Craft’s Ajax-based queue runner by calling Craft.cp.runQueue();
from your JavaScript. (You don’t need to factor in how the queue worker is set up when calling that.)
Hi @brandonkelly @angrybrad Thanks for the tips. Enupal Backup v1.5.0 is out and fixed manually calls to the queue->run
and also recommends to users to add a cron job to call craft queue/run
whenever they need scheduled backups.
Thanks @andrelopez !
Description
The Yii 2 queue package has drivers for lots of different queue services.
https://github.com/yiisoft/yii2-queue
If you've configured Craft to use one of them (SQS for example), you'll get the following error:
This comes from https://github.com/enupal/backup/blob/master/src/services/Backups.php#L98
The QueueInterface class that specifies the run method is Craft's class that the Yii2 queue libraries have no knowledge of.
I guess I'm not seeing why you wouldn't let the user/Craft decide when to process the queue.
Generally speaking, you don't want to manually trigger Craft's queue to run. i.e. on most installs, if someone triggers a manually backup from Craft's control panel, it'll start getting processed via the web-based queue runner when the page refreshes.
And if someone has set up a daemon or cron job to process Craft's queue, it'll get triggered immediately or whenever the next cron job is scheduled to run.
Seems like this plugin should just be pushing the job to the queue and calling it a day?
Additional info