File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,39 @@ class ScheduledJobController extends BaseController
1515 use DispatchesJobs;
1616 use ValidatesRequests;
1717
18+ /**
19+ * Increase the max execution time when handling a queued job.
20+ */
21+ protected function increaseExecutionTime (): void
22+ {
23+ ini_set ('max_execution_time ' , 0 );
24+ set_time_limit (0 );
25+ }
26+
27+ /**
28+ * Increase the memory limit when handling a queued job.
29+ */
30+ protected function increaseMemoryLimit (): void
31+ {
32+ ini_set ('memory_limit ' , '-1 ' );
33+ }
34+
1835 /**
1936 * Handle scheduled job event invocation.
2037 *
2138 * @return \Illuminate\Http\JsonResponse
2239 */
2340 public function index (): JsonResponse
2441 {
42+ $ this ->increaseExecutionTime ();
43+ $ this ->increaseMemoryLimit ();
44+
2545 Artisan::call ('schedule:run ' );
2646
27- return response ()->json (['info ' => 'The scheduled job has completed. ' ]);
47+ $ response = [
48+ 'info ' => 'The scheduled job has completed. ' ,
49+ ];
50+
51+ return response ()->json ($ reponse );
2852 }
2953}
You can’t perform that action at this time.
0 commit comments