Back in D7 we were able to give a timeout option to the drush command, thus have a poor-man's daemon

https://git.drupalcode.org/project/advancedqueue/-/blob/77719caa069717c9...

Issue is about adding this feature. Is there a reason it was removed, or simply not implemented?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu created an issue. See original summary.

kpa’s picture

[edit] ignore this post - test suite does not pass. See #3.

kpa’s picture

We needed this functionality so I've created a patch.

Attached and tested with Drush 9.

Usage:
drush advancedqueue:queue:process queuename --timeout=60
where:
- {queuename} is the id of your queue, as per the queue_id column of the advancedqueue database table, or `id` in the config yml
- --timeout={x} where {x} is a value in seconds. e.g. 60 = one minute

R0djer’s picture

Status: Active » Needs review

Tested. It works as expected.

mlemon’s picture

Re-rolled patch

jcnventura’s picture

Status: Needs review » Reviewed & tested by the community

This, according to #4

  • 93c2cbb committed on 8.x-1.x
    Issue #3133969 by kpa, mlemon, R0djer, jcnventura: Restore `timeout`...
jcnventura’s picture

Title: Re-add `timeout` option for Drush command » Restore `timeout` option for Drush command
Status: Reviewed & tested by the community » Fixed

Thanks everyone!

jsacksick’s picture

@jcnventura: Did you really test the patch? Also, please pay attention to the coding standards as they're comments longer than 80 characters for example, empty whitespaces... And I'm suspecting this change to cause #3319627: Upgrading from RC4 to RC5 slows down or stops cron running..

  • eaf2d52 committed on 8.x-1.x
    Revert "Issue #3133969 by kpa, mlemon, R0djer, jcnventura: Restore `...
jcnventura’s picture

Status: Fixed » Needs work

Reverted this, as it introduced the following problem from #3319627: Upgrading from RC4 to RC5 slows down or stops cron running.

At admin/config/system/cron set detailed cron logging.

At admin/reports/dblog "Starting execution of advancedqueue_cron()." for up to an hour.

Attempting to rerun cron from drush or admin ui results in, "Attempting to re-run cron while it is already running."

This happens on two virtually identical sites, dev and staging, whilst on the production site with rc4, cron runs normally with advancedqueue cron completing and stepping onto the next process within milliseconds.

jcnventura’s picture

This patch should only really use the timeout option to set the processing time and not try to daemonize the queue processor.

jcnventura’s picture

Status: Needs work » Needs review
Parent issue: » #3275594: Allow processor to keep running when queue gets empty
FileSize
3.37 KB

Modifying #4 this to only set the queue max processing time. Making the processor be idle in the background until that time is reached should be handled in #3275594: Allow processor to keep running when queue gets empty.

jcnventura’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.