Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
wants to merge 3 commits into from

4 participants

@richardkmiller

This is a tiny thing, but resque-web wasn't showing relative dates, e.g. "just now", with the current date format. I changed it to ISO 8601 to play better with resque-web's jQuery relatize_date.

@chrisboulton

It looks like this was a change made to Resque a few months ago: defunkt/resque@df08385

Don't suppose you know if it's been released as such?

I'd like to bring this in, but it looks like a backwards incompatible change with older versions of Resque. I'd say 1.3 (next release) is the best one because there are already other compatibility breaking changes.

Thanks for this. :thumbsup:

@richardkmiller

Interestingly, I changed the date format to ISO 8601 so it would work, not knowing that it was also being changed in [Ruby] Resque. We're using Resque 1.23.0 from Ubuntu 12.04 gems and that change is not yet present.

Releasing with 1.3 works for me.

@ruudk

Can you please update your PR so that it also includes the timestamp set in lib/Resque/Failure/Redis.php?

$data->failed_at = date('c');

I'm using the dev-master version of PHP-Resque so I'd like to see this merged :)

@ruudk ruudk referenced this pull request in michelsalib/BCCResqueBundle
Merged

Removed date filter from failed_list.html.twig #43

@richardkmiller

@ruudk Thanks for the heads up! Done.

@danhunsaker

1.3 is still looming. It would probably be good to define it and get the Internet working on churning out the code to get it released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/Resque/Failure/Redis.php
  2. +2 −2 lib/Resque/Worker.php
View
2  lib/Resque/Failure/Redis.php
@@ -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();
View
4 lib/Resque/Worker.php
@@ -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'));
}
/**
@@ -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);
Something went wrong with that request. Please try again.