Simplify scheduler to only consider task creation and number of queries
This commit is contained in:
parent
5185c1e225
commit
4e3bff9a70
2
NEWS.md
2
NEWS.md
@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user