Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php namespace App\Listeners\Queue;
  2.  
  3. use Illuminate\Support\Facades\Log;
  4. use Illuminate\Queue\Events\Looping;
  5.  
  6. class ShouldQueueWorkerContinue
  7. {
  8. public function handle(Looping $eventLooping)
  9. {
  10. // Query a service or database here to determine
  11. // if the $eventLooping->connectionName worker
  12. // should be paused.
  13. if ($isPaused) {
  14. Log::info("The queue worker {$eventLooping->connectionName} is PAUSED, not processing any jobs.");
  15. }
  16.  
  17. return !$isPaused;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement