Skip to content

Commit 56fcd4b

Browse files
committed
Docs.
1 parent 22c682e commit 56fcd4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ It will use your custom APP `QueueEmailTask` to send out emails via CLI.
209209

210210
Important: Do not forget to set your [domain](https://book.cakephp.org/3.0/en/core-libraries/email.html#sending-emails-from-cli) when sending from CLI.
211211

212-
### Avoid re-queuing
212+
### Avoiding parallel (re)queueing
213213

214214
For some background-tasks you will want to make sure only a single instance of this type is currently run.
215215
In your logic you can check on this using `isQueued()` and a unique reference:
@@ -229,10 +229,8 @@ In your logic you can check on this using `isQueued()` and a unique reference:
229229
}
230230

231231
$this->QueuedJobs->createJob(
232-
'Execute',
233-
[
234-
'command' => 'bin/cake importer run',
235-
],
232+
'Execute',
233+
['command' => 'bin/cake importer run'],
236234
['reference' => 'my-import', 'priority' => 2]
237235
);
238236

@@ -246,6 +244,8 @@ So if someone clicks on the button again before the job is finished, he will not
246244
<?= $this->Form->postLink(__('Trigger Import'), ['action' => 'triggerImport'], ['confirm' => 'Sure?']) ?>
247245
```
248246

247+
For more complex use cases, you can manually use `->find()->where()`, of course.
248+
249249
### Updating status
250250

251251
The `createJob()` method returns the entity. So you can store the ID and at any time ask the queue about the status of this job.

0 commit comments

Comments
 (0)