inst-jobs 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/delayed/cli.rb +8 -0
- data/lib/delayed/version.rb +1 -1
- data/lib/delayed/work_queue/parent_process/server.rb +15 -9
- 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: b63744bcf8a08c33dca7774529b4a20fb919771d
|
4
|
+
data.tar.gz: 4c5a5a634d64817e7ac47bc01182228d2b0a3c93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 217273201d1fd055e55c711e52d101051afd404b1b6dc75443901b4add9b03433e2c8e50bbaaa4d162defd321b7da911c5fafc9ba25fb2ac6541983f6070ec4e
|
7
|
+
data.tar.gz: 76ad540b9e89b1c5e60265cb4c5aa18c463eb51810f4c965546da578005759ba09bfdeb429e92b8dd7b1d4aedab117489ba4a3c84e4fb24f1bbbfb8a1abf1b4e
|
data/lib/delayed/cli.rb
CHANGED
@@ -2,7 +2,15 @@ require 'optparse'
|
|
2
2
|
|
3
3
|
module Delayed
|
4
4
|
class CLI
|
5
|
+
class << self
|
6
|
+
attr_accessor :instance
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :config
|
10
|
+
|
5
11
|
def initialize(args = ARGV)
|
12
|
+
self.class.instance = self
|
13
|
+
|
6
14
|
@args = args
|
7
15
|
# config that will be applied on Settings and passed to the created Pool
|
8
16
|
@config = {}
|
data/lib/delayed/version.rb
CHANGED
@@ -122,6 +122,8 @@ class ParentProcess
|
|
122
122
|
next if workers.empty?
|
123
123
|
|
124
124
|
logger.debug("Fetching new work for #{workers.length} workers")
|
125
|
+
jobs_to_send = []
|
126
|
+
|
125
127
|
Delayed::Worker.lifecycle.run_callbacks(:work_queue_pop, self, worker_config) do
|
126
128
|
recipients = workers.map(&:name)
|
127
129
|
|
@@ -142,15 +144,19 @@ class ParentProcess
|
|
142
144
|
end
|
143
145
|
client = workers.find { |worker| worker.name == worker_name }
|
144
146
|
client.working = true
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
147
|
+
jobs_to_send << [client, job]
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
jobs_to_send.each do |(client, job)|
|
152
|
+
@waiting_clients[worker_config].delete(client)
|
153
|
+
begin
|
154
|
+
logger.debug("Sending job #{job.id} to #{client.name}")
|
155
|
+
client_timeout { Marshal.dump(job, client.socket) }
|
156
|
+
rescue SystemCallError, IOError, Timeout::Error => ex
|
157
|
+
logger.error("Failed to send job to #{client.name}: #{ex.inspect}")
|
158
|
+
drop_socket(client.socket)
|
159
|
+
Delayed::Job.unlock([job])
|
154
160
|
end
|
155
161
|
end
|
156
162
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-08-
|
12
|
+
date: 2017-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: after_transaction_commit
|