postjob 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postjob/cli/ps.rb +15 -4
- data/lib/postjob/cli.rb +1 -1
- data/lib/postjob/queue.rb +1 -1
- data/lib/postjob/runner.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 041cef7de8f64274ba69bf907217d1268031c9cc
|
4
|
+
data.tar.gz: 8afbfab8f0320026c7bd89fdffdbdf88d497f7e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d30fc8fa4578c3031d543aef08422d6680a8f6379032ce0665b320b8bf39b071a93d332c7da212590c782ae53b6c52e7b592423b2892a83c5ff3f3ea91d23a7
|
7
|
+
data.tar.gz: 4ce5f6935aa6cc807ba5d9592d2762eecd932afa449578100b5f5967a94197d35995cc81bd2efe4f3b1fcbf7ed89268d31a9d165e444c5d0850e1e57bc0a5e04
|
data/lib/postjob/cli/ps.rb
CHANGED
@@ -19,14 +19,12 @@ module Postjob::CLI
|
|
19
19
|
|| workflow_version
|
20
20
|
|| (CASE WHEN workflow_method != 'run' THEN '.' || workflow_method ELSE '' END)
|
21
21
|
|| args AS job,
|
22
|
-
workflow_status,
|
22
|
+
workflow_status AS status,
|
23
23
|
status,
|
24
24
|
error,
|
25
25
|
COALESCE((results->0)::varchar, error_message) AS result,
|
26
26
|
next_run_at,
|
27
|
-
error_backtrace,
|
28
27
|
(now() at time zone 'utc') - created_at AS age,
|
29
|
-
updated_at - created_at AS runtime,
|
30
28
|
tags
|
31
29
|
FROM postjob.postjobs
|
32
30
|
WHERE #{condition_fragment}
|
@@ -64,7 +62,7 @@ module Postjob::CLI
|
|
64
62
|
end
|
65
63
|
|
66
64
|
conditions = []
|
67
|
-
conditions << "root_id=id OR status NOT IN ('ready', 'sleep', 'ok')"
|
65
|
+
conditions << "root_id=id OR status NOT IN ('ready', 'sleep', 'ok') OR failed_attempts > 0"
|
68
66
|
conditions << tags_condition(tags)
|
69
67
|
conditions << ids_condition(ids)
|
70
68
|
|
@@ -72,6 +70,19 @@ module Postjob::CLI
|
|
72
70
|
print_sql limit: limit, query: query
|
73
71
|
end
|
74
72
|
|
73
|
+
# Show all information about this job
|
74
|
+
def ps_show(id, *ids)
|
75
|
+
ids = ([ id ] + ids).map { |s| Integer(s) }
|
76
|
+
|
77
|
+
jobs = Simple::SQL.records <<~SQL, ids, into: Postjob::Job
|
78
|
+
SELECT * FROM postjob.postjobs WHERE id = ANY($1)
|
79
|
+
SQL
|
80
|
+
|
81
|
+
jobs.each do |job|
|
82
|
+
pp job
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
75
86
|
def ps_full(*ids, limit: 100, tags: nil)
|
76
87
|
conditions = []
|
77
88
|
conditions << tags_condition(tags)
|
data/lib/postjob/cli.rb
CHANGED
data/lib/postjob/queue.rb
CHANGED
@@ -244,7 +244,7 @@ module Postjob::Queue
|
|
244
244
|
|
245
245
|
return job if job
|
246
246
|
|
247
|
-
enqueue_job("#{workflow}.#{workflow_method}", *args, queue: parent.queue, parent_id: parent.id, timeout: timeout, max_attempts: max_attempts)
|
247
|
+
enqueue_job("#{workflow}.#{workflow_method}", *args, queue: parent.queue, parent_id: parent.id, timeout: timeout, max_attempts: max_attempts, tags: parent.tags)
|
248
248
|
end
|
249
249
|
|
250
250
|
def set_workflow_status(job, status)
|
data/lib/postjob/runner.rb
CHANGED
@@ -50,7 +50,7 @@ module Postjob::Runner
|
|
50
50
|
case job
|
51
51
|
when :all
|
52
52
|
if Postjob::Queue.next_unresolved_childjob(current_job)
|
53
|
-
Postjob.logger.
|
53
|
+
Postjob.logger.debug "await :all: Found an unresolved childjob"
|
54
54
|
throw :pending, :pending
|
55
55
|
else
|
56
56
|
childjobs = Postjob::Queue.childjobs(current_job)
|