When using the hosting_git module to receive webhooks it could happen that multiple git pull tasks were scheduled.

This would happen when the pull task is slow and a developer is pushing frequently.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

helmo created an issue. See original summary.

helmo’s picture

Status: Active » Needs review
FileSize
20 bytes
gboudrias’s picture

Status: Needs review » Active

Wrong patch file, just says "Already up-to-date.".

helmo’s picture

Status: Active » Needs review
FileSize
1.03 KB

sorry, here's the patch.

ergonlogic’s picture

ergonlogic’s picture

We should probably support the '--force' flag here, as we do with running a task that isn't queued. For example, it seems like it could be reasonable to queue up multiple tasks with backups or verifies in between...

ergonlogic’s picture

I'm not sure that this needs to be a WATCHDOG_WARNING either. I suspect a notice should be sufficient.

Also, enabling two Hosting Features at once appears to trigger two verify tasks on the hostmaster site. Might be a convenient way to test this.

helmo’s picture

I'm ok with it being a notice.

Not sure about the need for a --force option, when working from the cli I usually just run the task at hand, not queue it.

ergonlogic’s picture

If, for example, a remote SaaS front-end were to make a call to clone a template site multiple times, this patch would block that, no? --force would allow us to bypass this, at least. Ideally, we'd have a checklist of tasks to control this behaviour individually.

ergonlogic’s picture

Actually, I'm pretty sure #2694037: Forbid duplicates of certain task types is a duplicate of this, but appears further along. I'm going to close this one as a result. Feel free to re-open.

Amusingly, we've all been making the same arguments over there.

ergonlogic’s picture

Status: Needs review » Closed (duplicate)