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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59c807c8972b7fd832b05791eeadb33973a64c6b
4
- data.tar.gz: 4d53811bbce64a7810438d3280b234ad8a6c7dd0
3
+ metadata.gz: 041cef7de8f64274ba69bf907217d1268031c9cc
4
+ data.tar.gz: 8afbfab8f0320026c7bd89fdffdbdf88d497f7e3
5
5
  SHA512:
6
- metadata.gz: 623abb4dd78666f69c5182cc993e0f943b74b34c42693a9f451cd82dd765bcdaffdbf40a0cf84e63075b89d2e52594d26a817a1167e152c5ecff7919955becd5
7
- data.tar.gz: 0cad9c44bb0c42a160a610ba9d806ee2ffdc40b0b340609d341767a33464773d4a2140c5e1e71a1fd0cbe495b79d7df93341320c435785b8295e9ecbc324a2d3
6
+ metadata.gz: 3d30fc8fa4578c3031d543aef08422d6680a8f6379032ce0665b320b8bf39b071a93d332c7da212590c782ae53b6c52e7b592423b2892a83c5ff3f3ea91d23a7
7
+ data.tar.gz: 4ce5f6935aa6cc807ba5d9592d2762eecd932afa449578100b5f5967a94197d35995cc81bd2efe4f3b1fcbf7ed89268d31a9d165e444c5d0850e1e57bc0a5e04
@@ -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
@@ -20,7 +20,7 @@ module Postjob::CLI
20
20
  def load_environment(path)
21
21
  return unless File.exist?(path)
22
22
 
23
- logger.warn "#{path}: loading Postjob configuration"
23
+ logger.info "#{path}: loading Postjob configuration"
24
24
  load path
25
25
  end
26
26
 
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)
@@ -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.warn "await :all: Found an unresolved childjob"
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postjob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel