Module: Sentry::Cron::MonitorCheckIns::ClassMethods

Defined in:
lib/sentry/cron/monitor_check_ins.rb

Instance Method Summary collapse

Instance Method Details

#sentry_monitor_check_ins(slug: nil, monitor_config: nil) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/sentry/cron/monitor_check_ins.rb', line 46

def sentry_monitor_check_ins(slug: nil, monitor_config: nil)
  if monitor_config && Sentry.configuration
    cron_config = Sentry.configuration.cron
    monitor_config.checkin_margin ||= cron_config.default_checkin_margin
    monitor_config.max_runtime ||= cron_config.default_max_runtime
    monitor_config.timezone ||= cron_config.default_timezone
  end

  @sentry_monitor_slug = slug
  @sentry_monitor_config = monitor_config

  prepend Patch
end

#sentry_monitor_configObject



67
68
69
# File 'lib/sentry/cron/monitor_check_ins.rb', line 67

def sentry_monitor_config
  @sentry_monitor_config
end

#sentry_monitor_slug(name: self.name) ⇒ Object



60
61
62
63
64
65
# File 'lib/sentry/cron/monitor_check_ins.rb', line 60

def sentry_monitor_slug(name: self.name)
  @sentry_monitor_slug ||= begin
    slug = name.gsub("::", "-").downcase
    slug[-MAX_SLUG_LENGTH..-1] || slug
  end
end