Satchel
Satchel

Reputation: 16734

how to monitor and restart two ruby scripts with God?

I have been able to run a single god file for a single ruby script as such:

God.watch do |w|
  w.name = "twilio"
  w.start = "ruby ~/code/site/iron.io/twilio-listen.rb"
  w.keepalive
end

But I have two scripts and want to have God watch both of them (twilio-listen.rb and slack-listen.rb)

How do I do that?

Upvotes: 0

Views: 496

Answers (1)

konacaret
konacaret

Reputation: 181

You should be able to specify watches for both in the same God config file. You might also want to add a group called listeners if you ever needed to stop or restart them together. E.g.,

God.watch do |w|
  w.name = "twilio"
  w.group = "listeners"
  w.start = "ruby ~/code/site/iron.io/twilio-listen.rb"
  w.keepalive
end

God.watch do |w|
  w.name = "slack"
  w.group = "listeners"
  w.start = "ruby ~/code/site/iron.io/slack-listen.rb"
  w.keepalive
end

Upvotes: 1

Related Questions