From 4e3bff9a702c1bb1a7cd3fa2b4fd908da75d9fb5 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Thu, 20 Oct 2016 12:21:41 +0200 Subject: [PATCH] Simplify scheduler to only consider task creation and number of queries --- NEWS.md | 2 +- batch/scheduler/scheduler.js | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2c2c14ec..665308b6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ New features: * Batch queries are handled per db host. - There is an scheduler controlling how many queries and in what order they are run. - - Priority is based on: # of queries already run, last execution time, and oldest user in queue. + - Priority is based on: number of queries already ran, and oldest user in queue. * Batch queries capacity: allow to configure how many jobs to run per db host. diff --git a/batch/scheduler/scheduler.js b/batch/scheduler/scheduler.js index a05ac1ca..7ee10560 100644 --- a/batch/scheduler/scheduler.js +++ b/batch/scheduler/scheduler.js @@ -31,11 +31,6 @@ function Scheduler(capacity, taskRunner) { return taskEntityA.jobs - taskEntityB.jobs; } - // priority for entity with oldest executed job - if (taskEntityA.runAt !== taskEntityB.runAt) { - return taskEntityA.runAt - taskEntityB.runAt; - } - // priority for oldest job if (taskEntityA.createdAt !== taskEntityB.createdAt) { return taskEntityA.createdAt - taskEntityB.createdAt;