Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set job timestamp to ISO 8601 format so it can be properly 'relatized' #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/Resque/Failure/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Resque_Failure_Redis implements Resque_Failure_Interface
public function __construct($payload, $exception, $worker, $queue)
{
$data = new stdClass;
$data->failed_at = strftime('%a %b %d %H:%M:%S %Z %Y');
$data->failed_at = date('c');
$data->payload = $payload;
$data->exception = get_class($exception);
$data->error = $exception->getMessage();
Expand Down
4 changes: 2 additions & 2 deletions lib/Resque/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function workerPids()
public function registerWorker()
{
Resque::redis()->sadd('workers', (string)$this);
Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));
Resque::redis()->set('worker:' . (string)$this . ':started', date('c'));
}

/**
Expand Down Expand Up @@ -486,7 +486,7 @@ public function workingOn(Resque_Job $job)
$job->updateStatus(Resque_Job_Status::STATUS_RUNNING);
$data = json_encode(array(
'queue' => $job->queue,
'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'),
'run_at' => date('c'),
'payload' => $job->payload
));
Resque::redis()->set('worker:' . $job->worker, $data);
Expand Down