File: signal_test.rb

package info (click to toggle)
ruby-clockwork 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: ruby: 1,638; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'clockwork'
require 'active_support/time'

module Clockwork
  LOGFILE = File.expand_path('../../tmp/signal_test.log', __FILE__)

  handler do |job|
    File.write(LOGFILE, 'start')
    sleep 0.1
    File.write(LOGFILE, 'done')
  end

  configure do |config|
    config[:sleep_timeout] = 0
    config[:logger] = Logger.new(StringIO.new)
  end

  every(1.seconds, 'run.me.every.1.seconds')
end