Simplify scheduler to only consider task creation and number of queries

This commit is contained in:
Raul Ochoa 2016-10-20 12:21:41 +02:00
parent 5185c1e225
commit 4e3bff9a70
2 changed files with 1 additions and 6 deletions

View File

@ -4,7 +4,7 @@
New features: New features:
* Batch queries are handled per db host. * Batch queries are handled per db host.
- There is an scheduler controlling how many queries and in what order they are run. - 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. * Batch queries capacity: allow to configure how many jobs to run per db host.

View File

@ -31,11 +31,6 @@ function Scheduler(capacity, taskRunner) {
return taskEntityA.jobs - taskEntityB.jobs; 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 // priority for oldest job
if (taskEntityA.createdAt !== taskEntityB.createdAt) { if (taskEntityA.createdAt !== taskEntityB.createdAt) {
return taskEntityA.createdAt - taskEntityB.createdAt; return taskEntityA.createdAt - taskEntityB.createdAt;