Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/td/command/sched.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def sched_update(op)
timezone = nil
delay = nil
priority = nil
query = nil
retry_limit = nil
type = nil

Expand Down Expand Up @@ -177,6 +178,9 @@ def sched_update(op)
raise "unknown priority #{s.inspect} should be -2 (very-low), -1 (low), 0 (normal), 1 (high) or 2 (very-high)"
end
}
op.on('-Q', '--query PATH', 'use file instead of inline query') {|s|
query = File.open(s) { |f| f.read.strip }
}
op.on('-R', '--retry COUNT', 'automatic retrying count', Integer) {|i|
retry_limit = i
}
Expand All @@ -189,7 +193,7 @@ def sched_update(op)

params = {}
params['cron'] = cron if cron
params['query'] = sql if sql
params['query'] = sql || query if sql || query
params['database'] = db_name if db_name
params['result'] = result if result
params['timezone'] = timezone if timezone
Expand Down