Sha256: 5db26fa6951943217eaf9a9ed1ec7722c40069a1b372e1ca511858a21f23406e

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 Bytes

Contents

require 'leeroy/task'

module Leeroy
  module Task
    class Sleep < Leeroy::Task::Base

      def perform(args = self.args, options = self.options, global_options = self.global_options)
        super(args, options, global_options)

        begin
          logger.debug "performing for #{self.class}"
          logger.debug "state: #{self.state}"

          interval = self.options[:interval].to_i
          logger.debug "sleeping: #{interval} seconds"

          sleep interval

          dump_state

          logger.debug "done performing for #{self.class}"

        rescue StandardError => e
          raise e
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
leeroy_app-0.5.4 lib/leeroy/task/sleep.rb
leeroy_app-0.4.0 lib/leeroy/task/sleep.rb
leeroy_app-0.3.1 lib/leeroy/task/sleep.rb
leeroy_app-0.3.0 lib/leeroy/task/sleep.rb
leeroy_app-0.2.1 lib/leeroy/task/sleep.rb
leeroy_app-0.2.0 lib/leeroy/task/sleep.rb
leeroy_app-0.1.0 lib/leeroy/task/sleep.rb