Sha256: e07bdbbd10f473887ae31b294fa20909a03dbcba4a5a629375007960944f2383
Contents?: true
Size: 1.14 KB
Versions: 74
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true module Cron # # Base class for WeeklyJobs. # # Support running only on certain days as defined by day_of_week method # class Job < ApplicationJob cattr_accessor :cron_tab # # Method to set the cron_tab # def self.cron_tab_entry(entry) self.cron_tab = entry end # # Sends support an email if something goes awry # def send_support_email(error, event) email = EmailNotification.new email.to = 'support@app47.com' params = { current_date: I18n.l(Time.zone.today, format: :medium), event: event, error: error } email.from_template('support_ticket_notification', params) email.send_notification end # # Sends support a notification if something goes awry # def notify_job_failure(error, event) message = { job_name: self.class.to_s.titleize, event: event, error_message: error.message, stack_trace: error.backtrace } SlackNotification.say message, to: SystemConfiguration.slack_support_channel, template: :job_failure end end end
Version data entries
74 entries across 74 versions & 1 rubygems