Skip to content

Commit 7cecba9

Browse files
committed
Fix default timestamp
1 parent 2aab87d commit 7cecba9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Queue.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ public function __construct(string $name, QueueOpts $opts = null)
3636
*/
3737
public function add(string $name, array $data, JobOpts $opts = null)
3838
{
39+
$timestamp = (int) round(microtime(true) * 1000);
40+
3941
$opts = $opts ?: new JobOpts([
40-
'timestamp' => (int) round(microtime(true) * 1000),
42+
'timestamp' => $timestamp,
4143
]);
4244

45+
if (!$opts->timestamp) {
46+
$opts->timestamp = $timestamp;
47+
}
48+
4349
$prefix = sprintf('%s:%s:', $this->opts->prefix, $this->name);
4450

4551
return $this->client()->add(

0 commit comments

Comments
 (0)