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:
@ -246,6 +246,8 @@ sub checkJobsetWrapped {
|
||||
$jobset->update({ enabled => 0 }) if $jobset->enabled == 2;
|
||||
|
||||
$jobset->update({ lastcheckedtime => time });
|
||||
|
||||
$db->storage->dbh->do("notify builds_added");
|
||||
});
|
||||
|
||||
# Store the error messages for jobs that failed to evaluate.
|
||||
|
Reference in New Issue
Block a user