Skip to content

Commit

Permalink
Fix default timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ilzrv committed Dec 26, 2020
1 parent 2aab87d commit 7cecba9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ public function __construct(string $name, QueueOpts $opts = null)
*/
public function add(string $name, array $data, JobOpts $opts = null)
{
$timestamp = (int) round(microtime(true) * 1000);

$opts = $opts ?: new JobOpts([
'timestamp' => (int) round(microtime(true) * 1000),
'timestamp' => $timestamp,
]);

if (!$opts->timestamp) {
$opts->timestamp = $timestamp;
}

$prefix = sprintf('%s:%s:', $this->opts->prefix, $this->name);

return $this->client()->add(
Expand Down

0 comments on commit 7cecba9

Please sign in to comment.