move random() in TastyJobs to where it is more useful

This commit is contained in:
Oliver Gorwits
2018-02-23 23:54:08 +00:00
parent 78e5544dab
commit 93155d3f26
2 changed files with 4 additions and 3 deletions

View File

@@ -16,8 +16,7 @@ __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
ON (ds.backend = ? AND admin.device = ds.device
AND admin.action = ANY (ds.actionset))
WHERE admin.status = 'queued'
AND ds.device IS NULL
ORDER BY random())
AND ds.device IS NULL)
SELECT my_jobs.*,
CASE WHEN (my_jobs.username IS NOT NULL OR
@@ -37,7 +36,8 @@ __PACKAGE__->result_source_instance->view_definition(<<ENDSQL
ORDER BY job_priority DESC,
ds.deferrals ASC NULLS FIRST,
ds.last_defer ASC NULLS LAST,
device_key DESC NULLS LAST
device_key DESC NULLS LAST,
random()
LIMIT ?
ENDSQL
);