-
Notifications
You must be signed in to change notification settings - Fork 248
/
0099.yml
67 lines (67 loc) · 1.84 KB
/
0099.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: 99
description: Add more batched tasks fetching
methods:
get_multiple_tasks:
description: |-
Get tasks matching the given taskIds.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
mode: read
serviceName: queue
args: tasks_in jsonb, page_size_in integer, page_offset_in integer
returns: |-
table (
task_id text,
task_queue_id text,
scheduler_id text,
project_id text,
task_group_id text,
dependencies jsonb,
requires task_requires,
routes jsonb,
priority task_priority,
retries integer,
retries_left int,
created timestamptz,
deadline timestamptz,
expires timestamptz,
scopes jsonb,
payload jsonb,
metadata jsonb,
tags jsonb,
extra jsonb,
runs jsonb,
taken_until timestamptz
)
body: |-
begin
return query
select
tasks.task_id,
tasks.task_queue_id,
tasks.scheduler_id,
-- treat null project_id as 'none'
coalesce(tasks.project_id, 'none') as project_id,
tasks.task_group_id,
tasks.dependencies,
tasks.requires,
tasks.routes,
tasks.priority,
tasks.retries,
tasks.retries_left,
tasks.created,
tasks.deadline,
tasks.expires,
tasks.scopes,
tasks.payload,
tasks.metadata,
tasks.tags,
tasks.extra,
tasks.runs,
tasks.taken_until
from tasks
where
tasks.task_id in (SELECT jsonb_array_elements_text(tasks_in))
limit get_page_limit(page_size_in)
offset get_page_offset(page_offset_in);
end