postjob 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postjob/queue/notifications.rb +1 -1
- data/lib/postjob/queue.rb +19 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08479560788fb4e593c4c0ff8d1d70c54ff7f17
|
4
|
+
data.tar.gz: 393afe819d58f03bcff1314f819786be4c31cbc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b2cb1875294c491d6e38d8cfb196809bb221f1f92359c063f010620e2a044d602b968295617914b23aecbb314ebfaa53743d8a4e15b2aaadc5516b08ebfc2ef
|
7
|
+
data.tar.gz: 319849a057e3d791faabc7bf3f03e96a74a5b4f85858efee8af4efee119a2ae83035d73986e047365180f501cfca6a41f70a9731f1499fd39ab312df19a160a8
|
@@ -45,6 +45,6 @@ module Postjob::Queue::Notifications
|
|
45
45
|
# next runnable or timeoutable job comes up.
|
46
46
|
def time_to_next_job(worker_session_id)
|
47
47
|
expect! worker_session_id => /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i
|
48
|
-
Simple::SQL.ask "SELECT * FROM #{SCHEMA_NAME}.time_to_next_job($1)", worker_session_id
|
48
|
+
Simple::SQL.ask "SELECT * FROM #{SCHEMA_NAME}.time_to_next_job($1::uuid)", worker_session_id
|
49
49
|
end
|
50
50
|
end
|
data/lib/postjob/queue.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# rubocop:disable Layout/AlignParameters
|
2
2
|
# rubocop:disable Metrics/MethodLength
|
3
3
|
# rubocop:disable Metrics/ParameterLists
|
4
|
+
# rubocop:disable Metrics/LineLength
|
4
5
|
|
5
6
|
require "securerandom"
|
6
7
|
|
@@ -50,7 +51,7 @@ module Postjob::Queue
|
|
50
51
|
# a) a limitation in Simple::SQL which would not be able to unpack a
|
51
52
|
# "SELECT function()" usefully when the return value is a record;
|
52
53
|
# b) and/or my inability to write better SQL functions;
|
53
|
-
SQL.ask "SELECT * FROM #{SCHEMA_NAME}.enqueue($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)",
|
54
|
+
SQL.ask "SELECT * FROM #{SCHEMA_NAME}.enqueue($1::uuid, $2, $3, $4, $5, $6, $7, $8, $9, $10)",
|
54
55
|
worker_session_id,
|
55
56
|
options[:queue],
|
56
57
|
workflow,
|
@@ -66,17 +67,17 @@ module Postjob::Queue
|
|
66
67
|
|
67
68
|
def set_job_result(worker_session_id, job, value, version:)
|
68
69
|
value = Encoder.encode([value]) unless value.nil?
|
69
|
-
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_result($1, $2, $3, $4)", worker_session_id, job.id, value, version
|
70
|
+
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_result($1::uuid, $2, $3, $4)", worker_session_id, job.id, value, version
|
70
71
|
end
|
71
72
|
|
72
73
|
def set_job_pending(worker_session_id, job, version:)
|
73
|
-
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_pending($1, $2, $3)", worker_session_id, job.id, version
|
74
|
+
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_pending($1::uuid, $2, $3)", worker_session_id, job.id, version
|
74
75
|
end
|
75
76
|
|
76
77
|
def set_job_error(worker_session_id, job, error, error_message, error_backtrace = nil, status:, version:)
|
77
78
|
expect! status => [ :failed, :err, :timeout ]
|
78
79
|
|
79
|
-
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_error($1, $2, $3, $4, $5, $6, $7, $8)",
|
80
|
+
SQL.ask "SELECT #{SCHEMA_NAME}.set_job_error($1::uuid, $2, $3, $4, $5, $6, $7, $8)",
|
80
81
|
worker_session_id, job.id, error, error_message, Encoder.encode(error_backtrace), status, version, Postjob.fast_mode
|
81
82
|
end
|
82
83
|
|
@@ -107,18 +108,18 @@ module Postjob::Queue
|
|
107
108
|
# a) a limitation in Simple::SQL which would not be able to unpack a
|
108
109
|
# "SELECT function()" usefully when the return value is a record;
|
109
110
|
# b) and/or my inability to write better SQL functions;
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
111
|
+
SQL.ask "SELECT * FROM #{SCHEMA_NAME}.find_or_create_childjob($1::uuid, $2, $3, $4, $5, $6, $7, $8, $9, $10)",
|
112
|
+
worker_session_id,
|
113
|
+
queue,
|
114
|
+
workflow,
|
115
|
+
workflow_method,
|
116
|
+
nil, # version
|
117
|
+
Encoder.encode(args),
|
118
|
+
parent.id,
|
119
|
+
nil, # tags will be read from parent
|
120
|
+
max_attempts,
|
121
|
+
timeout,
|
122
|
+
into: Job
|
122
123
|
end
|
123
124
|
|
124
125
|
private
|
@@ -139,7 +140,7 @@ module Postjob::Queue
|
|
139
140
|
|
140
141
|
def checkout(worker_session_id)
|
141
142
|
expect! worker_session_id => UUID_REGEXP
|
142
|
-
SQL.ask "SELECT * FROM #{SCHEMA_NAME}.checkout($1, $2)", worker_session_id, Postjob.fast_mode, into: Job
|
143
|
+
SQL.ask "SELECT * FROM #{SCHEMA_NAME}.checkout($1::uuid, $2::boolean)", worker_session_id, Postjob.fast_mode, into: Job
|
143
144
|
end
|
144
145
|
|
145
146
|
def find_or_create_token(job)
|
@@ -164,7 +165,7 @@ module Postjob::Queue
|
|
164
165
|
def start_worker_session(workflows_with_versions, host_id:)
|
165
166
|
expect! host_id => UUID_REGEXP
|
166
167
|
|
167
|
-
Simple::SQL.ask "SELECT * FROM postjob.worker_session_start($1, $2)", host_id, workflows_with_versions, into: ::Postjob::WorkerSession
|
168
|
+
Simple::SQL.ask "SELECT * FROM postjob.worker_session_start($1::uuid, $2)", host_id, workflows_with_versions, into: ::Postjob::WorkerSession
|
168
169
|
end
|
169
170
|
|
170
171
|
# sends in a heartbeat
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|