File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ public function dispatchWebhooks()
137137 {
138138 $ webhooks = Config::get ('shopify-app.webhooks ' );
139139 if (count ($ webhooks ) > 0 ) {
140- WebhookInstaller::dispatch ($ this ->shop );
140+ WebhookInstaller::dispatch ($ this ->shop )-> onQueue (Config:: get ( ' shopify-app.job_queues.webhooks ' )) ;
141141 }
142142 }
143143
@@ -150,7 +150,7 @@ public function dispatchScripttags()
150150 {
151151 $ scripttags = Config::get ('shopify-app.scripttags ' );
152152 if (count ($ scripttags ) > 0 ) {
153- ScripttagInstaller::dispatch ($ this ->shop , $ scripttags );
153+ ScripttagInstaller::dispatch ($ this ->shop , $ scripttags )-> onQueue (Config:: get ( ' shopify-app.job_queues.scripttags ' )) ;
154154 }
155155 }
156156
@@ -178,7 +178,7 @@ public function dispatchAfterAuthenticate()
178178 $ job ::dispatchNow ($ this ->shop );
179179 } else {
180180 // Run later
181- $ job ::dispatch ($ this ->shop );
181+ $ job ::dispatch ($ this ->shop )-> onQueue (Config:: get ( ' shopify-app.job_queues.after_authenticate ' )) ;
182182 }
183183
184184 return true ;
Original file line number Diff line number Diff line change 266266 ],
267267 */
268268 ],
269+
270+ /*
271+ |--------------------------------------------------------------------------
272+ | Job Queues
273+ |--------------------------------------------------------------------------
274+ |
275+ | This option is for setting a specific job queue for webhooks, scripttags
276+ | and after_authenticate_job.
277+ |
278+ */
279+
280+ 'job_queues ' => [
281+ 'webhooks ' => env ('WEBHOOKS_JOB_QUEUE ' , null ),
282+ 'scripttags ' => env ('SCRIPTTAGS_JOB_QUEUE ' , null ),
283+ 'after_authenticate ' => env ('AFTER_AUTHENTICATE_JOB_QUEUE ' , null ),
284+ ],
269285];
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ public function testJobsRun()
169169 'src ' => 'https://localhost/scripts/file.js ' ,
170170 ],
171171 ]);
172+ Config::set ('shopify-app.job_queues.webhooks ' , 'custom-queue ' );
172173
173174 $ jobClass = \App \Jobs \AfterAuthenticateJob::class;
174175 Config::set ('shopify-app.after_authenticate_job ' , [[
@@ -187,6 +188,7 @@ public function testJobsRun()
187188 Queue::assertPushed (WebhookInstaller::class);
188189 Queue::assertPushed (ScripttagInstaller::class);
189190 Queue::assertPushed ($ jobClass );
191+ Queue::assertPushedOn ('custom-queue ' , WebhookInstaller::class);
190192 }
191193
192194 public function testAfterAuthenticateSingleJobRuns ()
You can’t perform that action at this time.
0 commit comments