You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ This package is for you if...
8
8
- you often create jobs to use just one single time **after a deployment**
9
9
- you sometimes **forgot to execute** that one specific job and stuff got crazy
10
10
- your code gets **cluttered with jobs**, that are not being used anymore
11
-
- you seed or process data in a migration file (which is a big no-no!)
11
+
- you often seed or process data **in a migration file** (which is a big no-no!)
12
12
13
-
And the best thing: They work as easy as **Laravel migrations**!
13
+
And the best thing: It works as easy as **Laravel migrations**!
14
14
15
15
## Installation
16
16
@@ -148,7 +148,7 @@ public function process(): void
148
148
By default, the operation is being processed ***asyncronously*** (based on your configuration) by dispatching the job `OneTimeOperationProcessJob`.
149
149
150
150
You can also execute the code syncronously by setting the `$async` flag to `false`.
151
-
_(this is only recommended for small operations, since the processing of these operations will be part of the deployment process)_
151
+
_(this is only recommended for small operations, since the processing of these operations should be part of the deployment process)_
152
152
153
153
### Processing the operations
154
154
@@ -170,23 +170,24 @@ After that, this operation will not be processed anymore.
170
170
171
171
### Dispatching Jobs syncronously or asyncronously
172
172
173
-
By default, all operations are being exectued with the `OneTimeOperationProcessJob` based on your `queue.default` configuration.
174
-
By providing the `--sync` or `--async` option, the `$async` attribute in all the files will be ignored and the operation will be executed based on the given flag.
173
+
For each operation a `OneTimeOperationProcessJob` is being dispatched,
174
+
either with `dispatch()` oder `dispatchSync()` based on the `$async` attribute in the operation file.
175
+
176
+
By providing the `--sync` or `--async` option with the `operations:process` command, you can force a syncronously/asyncronously execution and ignore the attribute:
175
177
176
178
```shell
177
-
php artisan operations:process --async // force OneTimeOperationProcessJob::dispatch()
178
-
php artisan operations:process --sync // force OneTimeOperationProcessJob::dispatchSync()
179
+
php artisan operations:process --async // force dispatch()
180
+
php artisan operations:process --sync // force dispatchSync()
179
181
```
180
182
181
183
**Hint!** If `operation:process` is part of your deployment process, it is **not recommended** to process the operations syncronously,
182
184
since an error in your operation could make your whole deployment fail.
183
185
184
-
### Re-run an operation manually
186
+
### Re-run an operation
185
187
186
188

187
189
188
-
If something went wrong, you can process an operation manually by providing the **name of the operation** as parameter in `operations:process`.
189
-
This will process the operation again, even if it was processed before (confirmation is required).
190
+
If something went wrong (or if you just feel like it), you can process an operation again by providing the **name of the operation** as parameter in `operations:process`.
0 commit comments