Sha256: 6419e5801fe428b6439ca698c5c1f067a60b2efe16160b547396f804de48b2e4

Contents?: true

Size: 571 Bytes

Versions: 10

Compression:

Stored size: 571 Bytes

Contents

# frozen-string-literal: true

require 'clockwork'
require 'active_support/time'

module Rodbot
  class Services
    class Schedule

      def tasks(**)
        puts "Starting schedule service"
        [method(:run)]
      end

      private

      def run
        Clockwork.instance_eval do
          configure { _1[:logger] = Rodbot::Log.logger('schedule') }
          handler { Rodbot::Async.perform(&_1) }
        end
        Rodbot.plugins.extend_schedule
        require Rodbot.env.root.join('config', 'schedule')
        Clockwork.run
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rodbot-0.4.1 lib/rodbot/services/schedule.rb
rodbot-0.4.0 lib/rodbot/services/schedule.rb
rodbot-0.3.4 lib/rodbot/services/schedule.rb
rodbot-0.3.3 lib/rodbot/services/schedule.rb
rodbot-0.3.2 lib/rodbot/services/schedule.rb
rodbot-0.3.1 lib/rodbot/services/schedule.rb
rodbot-0.3.0 lib/rodbot/services/schedule.rb
rodbot-0.2.0 lib/rodbot/services/schedule.rb
rodbot-0.1.1 lib/rodbot/services/schedule.rb
rodbot-0.1.0 lib/rodbot/services/schedule.rb