resque_stuck_queue 0.2.0 → 0.2.1
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 +5 -5
- data/README.md +1 -1
- data/lib/resque_stuck_queue.rb +4 -6
- data/lib/resque_stuck_queue/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA512:
|
3
|
-
metadata.gz: 8441e82a5f962f49c9de740fd9a843c50b3125458c69f08598b210774b2920f6bac676f87a748c095aafdcc86799934229a03ba5c2cc0c8a906f3834f484cc7c
|
4
|
-
data.tar.gz: 824e77bbf4ab0c7fa6b150e69ed0a4845d4e6a18022715b51880e60af7ba189be704277d0776aa91bbe39003b09f5b8f22895421484b10bb6c454b73f77391d7
|
5
2
|
SHA1:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21e22e07449416caa592d83157978103b6d3cb25
|
4
|
+
data.tar.gz: 52261706a53625364f3bddc7c531e8e1a1e38fa8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8da0b6facf25ed6034205a78d0ace7cac2c62aae772b6fbd0a2ae4c7d4fa5964f61f7ee341b7c784ef3e30b89561d4cff1fb012faf97f3206d1e54a87845b0d3
|
7
|
+
data.tar.gz: e1fa87dff4f06d265d2e9a9a5facfe84fa9a1d42891c1f1e259f3850c8fe9ce10e032eeff2b9955bdf827ba5142520f542bc318ee8879669fbee2e1c524f9a9f
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ queues:
|
|
73
73
|
abort_on_exception:
|
74
74
|
optional, if you want the resque-stuck-queue threads to explicitly raise, default is false
|
75
75
|
|
76
|
-
|
76
|
+
heartbeat_job:
|
77
77
|
optional, your own custom refreshing job. if you are using something other than resque
|
78
78
|
|
79
79
|
</pre>
|
data/lib/resque_stuck_queue.rb
CHANGED
@@ -76,8 +76,8 @@ module Resque
|
|
76
76
|
|
77
77
|
Redis::Classy.db = redis if Redis::Classy.db.nil?
|
78
78
|
|
79
|
-
|
80
|
-
|
79
|
+
setup_heartbeat_thread
|
80
|
+
setup_watcher_thread
|
81
81
|
|
82
82
|
# fo-eva.
|
83
83
|
@threads.map(&:join)
|
@@ -122,7 +122,7 @@ module Resque
|
|
122
122
|
|
123
123
|
private
|
124
124
|
|
125
|
-
def
|
125
|
+
def setup_heartbeat_thread
|
126
126
|
@threads << Thread.new do
|
127
127
|
Thread.current.abort_on_exception = config[:abort_on_exception]
|
128
128
|
logger.info("Starting heartbeat thread")
|
@@ -143,13 +143,11 @@ module Resque
|
|
143
143
|
else
|
144
144
|
queues.each do |queue_name|
|
145
145
|
Resque.enqueue_to(queue_name, HeartbeatJob, [heartbeat_key_for(queue_name), redis.client.host, redis.client.port])
|
146
|
-
queue_name = :snapshot_progress
|
147
|
-
Resque.enqueue_to(queue_name, HeartbeatJob, [Resque::StuckQueue.heartbeat_key_for(queue_name), Resque.redis.client.host, Resque.redis.client.port])
|
148
146
|
end
|
149
147
|
end
|
150
148
|
end
|
151
149
|
|
152
|
-
def
|
150
|
+
def setup_watcher_thread
|
153
151
|
@threads << Thread.new do
|
154
152
|
Thread.current.abort_on_exception = config[:abort_on_exception]
|
155
153
|
logger.info("Starting checker thread")
|