Skip to content

Commit

Permalink
Heartbeat should now work also on distributed systems
Browse files Browse the repository at this point in the history
  • Loading branch information
philkman committed Apr 17, 2015
1 parent 3c67abc commit e878263
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/queue_dispatcher/acts_as_task_queue.rb
Expand Up @@ -66,9 +66,8 @@ def pid_running?(pid)

# Check if QueueDispatcher is running.
def qd_running?
hb_tqs = TaskQueue.where(state: 'heartbeat')
running = false
hb_tqs.each { |tq| running = true if pid_running?(tq.pid) && tq.updated_at > 1.minute.ago }
TaskQueue.where(state: 'heartbeat').each { |tq| running = true if tq.updated_at > 1.minute.ago }
running
end

Expand Down
2 changes: 1 addition & 1 deletion lib/queue_dispatcher/version.rb
@@ -1,3 +1,3 @@
module QueueDispatcher
VERSION = "2.4.0"
VERSION = "2.4.1"
end

0 comments on commit e878263

Please sign in to comment.