Skip to content

Commit

Permalink
Client#run_schedule returns [ScheduledJob]
Browse files Browse the repository at this point in the history
  • Loading branch information
frsyuki committed Mar 12, 2012
1 parent 2ed24f1 commit f46ad5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/td/client.rb
Expand Up @@ -195,10 +195,12 @@ def history(name, from=nil, to=nil)
} }
end end


# TODO nil -> [ScheduledJob] or [Job] # [ScheduledJob]
def run_schedule(name, time, num) def run_schedule(name, time, num)
@api.run_schedule(name, time, num) results = @api.run_schedule(name, time, num)
nil results.map {|job_id,type,scheduled_at|
ScheduledJob.new(self, scheduled_at, job_id, type, nil)
}
end end


# => time:Flaot # => time:Flaot
Expand Down
3 changes: 2 additions & 1 deletion lib/td/client/api.rb
Expand Up @@ -477,7 +477,8 @@ def run_schedule(name, time, num)
js['jobs'].each {|m| js['jobs'].each {|m|
job_id = m['job_id'] job_id = m['job_id']
scheduled_at = m['scheduled_at'] scheduled_at = m['scheduled_at']
result << [job_id, scheduled_at] type = (m['type'] || '?').to_sym
result << [job_id, type, scheduled_at]
} }
return result return result
end end
Expand Down

0 comments on commit f46ad5f

Please sign in to comment.