Skip to content

Commit

Permalink
Merge remote-tracking branch 'YotpoLtd/feature-last-execution' into Y…
Browse files Browse the repository at this point in the history
…otpoLtd-feature-last-execution

Conflicts:
	.rubocop.yml
	lib/resque/scheduler.rb
	lib/resque_scheduler.rb
	lib/resque_scheduler/server/views/scheduler.erb
  • Loading branch information
meatballhat committed Feb 20, 2014
2 parents c15ed48 + c907a86 commit 4d5f359
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/resque/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def load_schedule_job(name, config)
job = rufus_scheduler.send(interval_type, *args) do
if master?
log! "queueing #{config['class']} (#{name})"
Resque.set_last_run(name, Time.now.to_s)
Resque.last_enqueued_at(name, Time.now.to_s)
handle_errors { enqueue_from_config(config) }
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/resque_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,12 @@ def scheduled_at(klass, *args)
end
end

def set_last_run(job_name, date)
redis.hset('delayed:last_run', job_name, date)
def last_enqueued_at(job_name, date)
redis.hset('delayed:last_enqueued_at', job_name, date)
end

def get_last_run(job_name)
redis.hget('delayed:last_run', job_name)
def get_last_enqueued_at(job_name)
redis.hget('delayed:last_enqueued_at', job_name)
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/resque_scheduler/server/views/scheduler.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td><%= h schedule_class(config) %></td>
<td><%= h config['queue'] || queue_from_class_name(config['class']) %></td>
<td><%= h config['args'].inspect %></td>
<td><%= h Resque.get_last_run(name) || 'Never' %></td>
<td><%= h Resque.get_last_enqueued_at(name) || 'Never' %></td>
</tr>
<% end %>
</table>
Expand Down

0 comments on commit 4d5f359

Please sign in to comment.