rocketjob 5.3.1 → 5.3.2
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/rocket_job/plugins/cron.rb +2 -12
- data/lib/rocket_job/subscribers/server.rb +9 -3
- data/lib/rocket_job/supervisor.rb +3 -1
- data/lib/rocket_job/version.rb +1 -1
- data/lib/rocket_job/worker_pool.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fc6fef03f96de2e2645a4419a4f4f0cdf409da64a7bb708bcddb24ae0fc6c4f
|
4
|
+
data.tar.gz: 4c8573924fae294676afc2114a83b522c64a3b259e679a2a343fc4b34f7bab8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e21ca8c550d28e77d48a6b47b3f7e0c822350e72ba557e56749277f8a2536cd669f63b86b20c39bc264b8619196f40a2aa38940cb04aedaad1a1a07daa36b666
|
7
|
+
data.tar.gz: cd3202dd8ecf093ba591385aab9529f8f8f2d1bf7f286252db9ab7589f49c86293d96f3e72bd5ba85eed6b344eb92f35414cc3c32ee327dcf00f722b4929d2a4
|
@@ -45,20 +45,10 @@ module RocketJob
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
# Returns [Time] the next time this job will be scheduled to run at.
|
49
|
-
#
|
50
|
-
# Parameters
|
51
|
-
# time: [Time]
|
52
|
-
# The next time as of this time.
|
53
|
-
# Default: Time.now
|
54
|
-
def rocket_job_cron_next_time(time = Time.now)
|
55
|
-
Fugit::Cron.new(cron_schedule).next_time.to_utc_time
|
56
|
-
end
|
57
|
-
|
58
48
|
def rocket_job_cron_set_run_at
|
59
|
-
return
|
49
|
+
return if cron_schedule.nil? || !(cron_schedule_changed? && !run_at_changed?)
|
60
50
|
|
61
|
-
self.run_at =
|
51
|
+
self.run_at = Fugit::Cron.new(cron_schedule).next_time.to_utc_time
|
62
52
|
end
|
63
53
|
end
|
64
54
|
end
|
@@ -9,16 +9,22 @@ module RocketJob
|
|
9
9
|
@supervisor = supervisor
|
10
10
|
end
|
11
11
|
|
12
|
-
def kill(server_id: nil, name: nil, wait_timeout:
|
12
|
+
def kill(server_id: nil, name: nil, wait_timeout: 5)
|
13
13
|
return unless my_server?(server_id, name)
|
14
14
|
|
15
15
|
supervisor.synchronize do
|
16
|
+
Supervisor.shutdown!
|
17
|
+
|
18
|
+
supervisor.logger.info("Stopping Pool")
|
16
19
|
supervisor.worker_pool.stop
|
17
|
-
supervisor.worker_pool.
|
20
|
+
unless supervisor.worker_pool.living_count == 0
|
21
|
+
supervisor.logger.info("Giving pool #{wait_timeout} seconds to terminate")
|
22
|
+
sleep(wait_timeout)
|
23
|
+
end
|
24
|
+
supervisor.logger.info("Kill Pool")
|
18
25
|
supervisor.worker_pool.kill
|
19
26
|
end
|
20
27
|
|
21
|
-
Supervisor.shutdown!
|
22
28
|
logger.info "Killed"
|
23
29
|
end
|
24
30
|
|
@@ -55,7 +55,9 @@ module RocketJob
|
|
55
55
|
|
56
56
|
def stop!
|
57
57
|
server.stop! if server.may_stop?
|
58
|
-
|
58
|
+
synchronize do
|
59
|
+
worker_pool.stop
|
60
|
+
end
|
59
61
|
until worker_pool.join
|
60
62
|
logger.info "Waiting for workers to finish processing ..."
|
61
63
|
# One or more workers still running so update heartbeat so that server reports "alive".
|
data/lib/rocket_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.3.
|
4
|
+
version: 5.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
- !ruby/object:Gem::Version
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
|
-
rubygems_version: 3.
|
227
|
+
rubygems_version: 3.1.2
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: Ruby's missing batch processing system.
|