Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# How would I write a spec for this?
# specifically the resuce...

def wake_up_backgroundrb
   begin
     # try to contact Backgroundrb in some way
     MiddleMan.gc!((Time.now-1.years).to_time)
   rescue
     begin
       `cd #{RAILS_ROOT} && rake backgroundrb:restart`
       sleep(5)
     rescue
       logger.error("unable to start Backgroundrb: #{$!}")
     end
   end
end