Sha256: f4b8b4d1e0557b9a54708242bee584fd23f2817a5c21be27cc8ba65f9c1b6e1d

Contents?: true

Size: 602 Bytes

Versions: 12

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  module CheckIn
    class Cron
      # @api private
      attr_reader :identifier, :digest

      def initialize(identifier:)
        @identifier = identifier
        @digest = SecureRandom.hex(8)
      end

      def start
        CheckIn.scheduler.schedule(event("start"))
      end

      def finish
        CheckIn.scheduler.schedule(event("finish"))
      end

      private

      def event(kind)
        Event.cron(
          :identifier => @identifier,
          :digest => @digest,
          :kind => kind
        )
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
appsignal-4.2.1-java lib/appsignal/check_in/cron.rb
appsignal-4.2.1 lib/appsignal/check_in/cron.rb
appsignal-4.2.0-java lib/appsignal/check_in/cron.rb
appsignal-4.2.0 lib/appsignal/check_in/cron.rb
appsignal-4.1.3-java lib/appsignal/check_in/cron.rb
appsignal-4.1.3 lib/appsignal/check_in/cron.rb
appsignal-4.1.2-java lib/appsignal/check_in/cron.rb
appsignal-4.1.2 lib/appsignal/check_in/cron.rb
appsignal-4.1.1-java lib/appsignal/check_in/cron.rb
appsignal-4.1.1 lib/appsignal/check_in/cron.rb
appsignal-4.1.0-java lib/appsignal/check_in/cron.rb
appsignal-4.1.0 lib/appsignal/check_in/cron.rb