File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,9 @@ public function through($middleware)
197
197
*/
198
198
public function chain ($ chain )
199
199
{
200
- $ this ->chained = collect ($ chain )->map (function ($ job ) {
200
+ $ jobs = ChainedBatch::prepareNestedBatches (collect ($ chain ));
201
+
202
+ $ this ->chained = $ jobs ->map (function ($ job ) {
201
203
return $ this ->serializeJob ($ job );
202
204
})->all ();
203
205
@@ -212,7 +214,9 @@ public function chain($chain)
212
214
*/
213
215
public function prependToChain ($ job )
214
216
{
215
- $ this ->chained = Arr::prepend ($ this ->chained , $ this ->serializeJob ($ job ));
217
+ $ jobs = ChainedBatch::prepareNestedBatches (collect ([$ job ]));
218
+
219
+ $ this ->chained = Arr::prepend ($ this ->chained , $ this ->serializeJob ($ jobs ->first ()));
216
220
217
221
return $ this ;
218
222
}
@@ -225,7 +229,9 @@ public function prependToChain($job)
225
229
*/
226
230
public function appendToChain ($ job )
227
231
{
228
- $ this ->chained = array_merge ($ this ->chained , [$ this ->serializeJob ($ job )]);
232
+ $ jobs = ChainedBatch::prepareNestedBatches (collect ([$ job ]));
233
+
234
+ $ this ->chained = array_merge ($ this ->chained , [$ this ->serializeJob ($ jobs ->first ())]);
229
235
230
236
return $ this ;
231
237
}
You can’t perform that action at this time.
0 commit comments