Use PostgreSQL notifications for queue events
Hydra-queue-runner now no longer polls the queue periodically, but instead sleeps until it receives a notification from PostgreSQL about a change to the queue (build added, build cancelled or build restarted). Also, for the "build added" case, we now only check for builds with an ID greater than the previous greatest ID. This is much more efficient if the queue is large.
This commit is contained in:
@ -469,6 +469,8 @@ sub restartBuilds($$) {
|
||||
# FIXME: Add this to the API.
|
||||
# FIXME: clear the dependencies?
|
||||
$db->resultset('FailedPaths')->search({ path => [ @paths ]})->delete;
|
||||
|
||||
$db->storage->dbh->do("notify builds_restarted");
|
||||
});
|
||||
|
||||
return scalar(@buildIds);
|
||||
|
Reference in New Issue
Block a user