«
Rule languages supports cron features
def five_seconds_from_now
cron = (Time.now + 5).strftime('%S %M %H ? * ?').tap { |cron| logger.info(cron)}
end
rule 'Using Cron Syntax' do
cron five_seconds_from_now
run { logger.info "Cron rule executed" }
end
schedule = Time.now + 5
rule 'Using Cron Syntax' do
cron second: schedule.sec, minute: schedule.min
run { logger.info "Cron rule executed" }
end