Skip to content

Commit 9e91551

Browse files
committed
formatting
1 parent c3207e2 commit 9e91551

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

docs/commands.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ Available options:
2121

2222
Allows you to publish a configuration class in the application namespace.
2323

24-
#### Example
24+
##### Example
2525

2626
php spark queue:publish
2727

2828
### queue:job
2929

3030
Generates a new job file.
3131

32-
#### Arguments
32+
##### Arguments
3333

3434
* `name` - The job class name.
3535

36-
#### Options
36+
##### Options
3737

3838
* `--namespace` - Set root namespace. Default: "APP_NAMESPACE".
3939
* `--suffix` - Append the component title to the class name (e.g. Email => EmailJob).
4040
* `--force` - Force overwrite existing file.
4141

42-
#### Example
42+
##### Example
4343

4444
php spark queue:job Email
4545

@@ -49,11 +49,11 @@ It will generate the `Email` class in the `App\Jobs` namespace.
4949

5050
Allows you to consume jobs from a specific queue.
5151

52-
#### Arguments
52+
##### Arguments
5353

5454
* `queueName` - Name of the queue we will work with.
5555

56-
#### Options
56+
##### Options
5757

5858
* `-sleep` - Wait time between the next check for available job when the queue is empty. Default value: `10` (seconds).
5959
* `-rest` - Rest time between the jobs in the queue. Default value: `0` (seconds)
@@ -64,7 +64,7 @@ Allows you to consume jobs from a specific queue.
6464
* `-retry-after` - The number of seconds after which the job is to be restarted in case of failure. Overrides settings from the Job class. Disabled by default.
6565
* `--stop-when-empty` - Stop when the queue is empty.
6666

67-
#### Example
67+
##### Example
6868

6969
php spark queue:work emails -max-jobs 5
7070

@@ -74,35 +74,35 @@ It will listen for 5 jobs from the `emails` queue and then stop.
7474

7575
Allows you to stop a specific queue in a safe way. It does this as soon as the job that is running in the queue is completed.
7676

77-
#### Arguments
77+
##### Arguments
7878

7979
* `queueName` - Name of the queue we will work with.
8080

81-
#### Example
81+
##### Example
8282

8383
php spark queue:stop emails
8484

8585
### queue:clear
8686

8787
Allows you to remove all jobs from a specific queue.
8888

89-
#### Arguments
89+
##### Arguments
9090

9191
* `queueName` - Name of the queue we will work with.
9292

93-
#### Example
93+
##### Example
9494

9595
php spark queue:clear emails
9696

9797
### queue:failed
9898

9999
Allows you to view all failed jobs. Also only from a specific queue
100100

101-
#### Options
101+
##### Options
102102

103103
* `-queue` - Queue name.
104104

105-
#### Example
105+
##### Example
106106

107107
php spark queue:failed -queue emails
108108

@@ -112,15 +112,15 @@ It will list failed jobs from the `emails` queue.
112112

113113
Allows you to retry failed jobs back to the queue.
114114

115-
#### Arguments
115+
##### Arguments
116116

117117
* `id` - ID of the failed job or "all" for all failed jobs.
118118

119-
#### Options
119+
##### Options
120120

121121
* `-queue` - Queue name.
122122

123-
#### Example
123+
##### Example
124124

125125
php spark queue:retry all -queue emails
126126

@@ -130,24 +130,24 @@ It will retry all the failed jobs from the `emails` queue.
130130

131131
Allows you to delete the failed job by ID
132132

133-
#### Arguments
133+
##### Arguments
134134

135135
* `id` - ID of the failed job.
136136

137-
#### Example
137+
##### Example
138138

139139
php spark queue:forget 123
140140

141141
### queue:flush
142142

143143
Allows you to delete many failed jobs at once. Based on the failed date and queue.
144144

145-
#### Options
145+
##### Options
146146

147147
* `-hours` - Number of hours.
148148
* `-queue` - Queue name.
149149

150-
#### Example
150+
##### Example
151151

152152
php spark queue:flush -hours 6
153153

docs/running_queues.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ Running a queue can be done in several ways. It all depends on what kind of envi
66

77
Since Supervisor is taking care of everything for us and will make out queue worker up and running, we can use this command:
88

9-
```cli
10-
php spark queue:work emails -wait 10
11-
```
9+
php spark queue:work emails -wait 10
1210

1311
This will cause command to check for the new jobs every 10 seconds if the queue is empty. But it will not quit. Waiting time is important since we don't want to overflow out database with the unnecessary queries.
1412

1513
### With CRON
1614

1715
Using queues with CRON is more challenging, but definitely doable. You can use command like this:
1816

19-
```cli
20-
php spark queue:work emails -max-jobs 20 --stop-when-empty
21-
```
17+
php spark queue:work emails -max-jobs 20 --stop-when-empty
2218

2319
We can schedule CRON to execute our command every minute. This way, if there are no emails to handle, the command will quit immediately. And if there are many emails the batch of 20 will be handled every minute.
2420

@@ -36,8 +32,6 @@ As mentioned above, sometimes we may want to have multiple instances of the same
3632

3733
If we decide to run the long process e.g. with the command:
3834

39-
```cli
40-
php spark queue:work emails -wait 10
41-
```
35+
php spark queue:work emails -wait 10
4236

4337
We must remember to restart our command every time we add a new job or change the code in the existing job files. The reason is that the changes will not be visible before we restart the command.

0 commit comments

Comments
 (0)