Skip to content

Commit 56b628e

Browse files
committed
fix: patch up job options not applying
1 parent 0a9c663 commit 56b628e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/Job.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class Job implements Dispatchable
3030
/**
3131
* Number of seconds to wait before processing a job
3232
*/
33-
protected int $delay = 0;
33+
protected $delay = 0;
3434

3535
/**
3636
* Number of seconds to wait before retrying a job that has failed.
@@ -108,6 +108,7 @@ public function getJobId()
108108
*/
109109
public function handleDelay()
110110
{
111+
echo "Job #{$this->job['id']} is delayed for {$this->delay} seconds\n";
111112
sleep($this->delay);
112113
}
113114

@@ -124,7 +125,7 @@ public function hasExpired()
124125
*/
125126
public function handleExpiry()
126127
{
127-
echo "Job {$this->job['id']} has expired\n";
128+
echo "Job #{$this->job['id']} has expired\n";
128129
$this->queue->pop($this->job['id']);
129130
}
130131

@@ -195,15 +196,13 @@ public function stack()
195196
public function getConfig()
196197
{
197198
return [
198-
'delay' => 0,
199-
'delayBeforeRetry' => 0,
200-
'expire' => 60,
201-
'force' => false,
202-
'memory' => 128,
203-
'quitOnEmpty' => false,
204-
'sleep' => 3,
205-
'timeout' => 60,
206-
'tries' => 3,
199+
'delay' => $this->delay,
200+
'delayBeforeRetry' => $this->delayBeforeRetry,
201+
'expire' => $this->expire,
202+
'force' => $this->force,
203+
'memory' => $this->memory,
204+
'timeout' => $this->timeout,
205+
'tries' => $this->tries,
207206
'data' => static::$data,
208207
];
209208
}

0 commit comments

Comments
 (0)