app/workers/sidekiq/snitch.rb in sidekiq_snitch-1.0.0 vs app/workers/sidekiq/snitch.rb in sidekiq_snitch-1.1.0

- old
+ new

@@ -1,18 +1,20 @@ require 'sidekiq' require 'net/http' -# A worker to contact deadmanssnitch.com every five minutes, +# A worker to contact deadmanssnitch.com periodically, # thereby ensuring jobs are being performed and the system # is healthy. module Sidekiq class Snitch include Sidekiq::Worker def perform - Net::HTTP.get(URI(ENV['SIDEKIQ_SNITCH_URL'])) + if ENV['SIDEKIQ_SNITCH_URL'].present? + Net::HTTP.get(URI(ENV['SIDEKIQ_SNITCH_URL'])) - # groundhog day! - Snitch.perform_in(1.hour) + # groundhog day! + Snitch.perform_in(1.hour) + end end end end