From 0f8a51aa6859c593528e6cbac8f6ec83f9a3ef3e Mon Sep 17 00:00:00 2001 From: Tobi Kremer Date: Thu, 12 Sep 2019 10:15:04 +0200 Subject: [PATCH 1/2] Improve documentation for getJobs() Clarify use of `start` and `end` options. Closes #1454. --- REFERENCE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 67337a09d..7db44e231 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -412,7 +412,9 @@ parameter. If the specified job cannot be located, the promise will be resolved getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise ``` -Returns a promise that will return an array of job instances of the given types. Optional parameters for range and ordering are provided. +Returns a promise that will return an array of job instances of the given types. Optional parameters for range and ordering are provided. + +Note: The `start` and `end` options are applied **per job type**. For example, if there are 10 jobs in state `completed` and 10 jobs in state `active`, `getJobs(['completed', 'active'], 0, 4)` will yield an array with 10 entries, representing the first 5 completed jobs (0 - 4) and the first 5 waiting jobs (0 - 4). --- @@ -425,7 +427,7 @@ getJobLogs(jobId: string, start?: number, end?: number): Promise<{ }> ``` -Returns a object with the logs according to the stard and end arguments. The returned count +Returns a object with the logs according to the start and end arguments. The returned count value is the total amount of logs, useful for implementing pagination. --- From 57ee8d245ce0913620d19a90964b4c0b19b824ee Mon Sep 17 00:00:00 2001 From: Tobi Kremer Date: Fri, 13 Sep 2019 08:49:28 +0200 Subject: [PATCH 2/2] Fix typo in docs --- REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 7db44e231..2c71ba402 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -414,7 +414,7 @@ getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise