Sha256: 2a73607119416fc7d44d5021c300d447c92f995b5525428b8419ef1e48508c6c
Contents?: true
Size: 826 Bytes
Versions: 12
Compression:
Stored size: 826 Bytes
Contents
require 'shopapp/panicker_api' namespace :shopapp do # rake shopapp:jobmonit desc "check if jobs engine are running" task jobmonit: :environment do ShopappMonitJob.perform_later sleep 15 timestamp = File.read(Rails.root.join('tmp', 'shopapp_monit_job')).to_datetime if Time.now - timestamp > 300 PanickerApi.general_message "Background jobs delay more than 5 minutes in #{Rails.application.class.parent_name.capitalize}." elsif Time.now - timestamp > 60 PanickerApi.general_message "Background jobs delay more than 1 minutes in #{Rails.application.class.parent_name.capitalize}." else puts "Jobs are executing fine." end rescue PanickerApi.general_message "Background jobs error, monit file not found on #{Rails.application.class.parent_name.capitalize}." end end
Version data entries
12 entries across 12 versions & 1 rubygems