Replies: 2 comments 3 replies
-
Seems like a reasonable change. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I’ll try for a PR this afternoon (ish) 👍🏻
…On Tue, May 12, 2020 at 10:52 Taylor Otwell ***@***.***> wrote:
Seems like a reasonable change.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32779 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADSDU4P7JSXTA43PKMG64TRRFWB7ANCNFSM4M62GCEA>
.
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm investigating doing some cleanup on some temp files while not relying on
__destruct()
(which sometimes is called too early).I found the following. It's not necessarily an issue but was interesting/a bit inconsistent.
I have a queue job that registers a callback with
app()->terminating()
:Here's what I found:
queue:listen
gets a log line for every job, which makes sense asqueue:listen
restarts the framework for each jobqueue:work --once
gets a log line for every job since it fires once and then allows the framework to stop (nowhile (true)
loop)queue:work
- Does NOT get a log line, ever. This is becauseIlluminate\Queue\Worker
usesexit($status)
to stop the worker in all cases (graceful shutdown and ungraceful). This stops the framework from doing regular shutdown behavior.This is obviously not an issue for most, but since I ran into it, I wanted to see if it was worth changing.
The most obvious solution would be to call
app()->terminate()
just before exiting. This seems to be exactly what happens for web requests, so it doesn't feel like it would miss too much in terms of shutdown behavior.Note that the Console Kernel object also calls
app()->terminate()
so all other artisan calls are terminating the app.It's really just
queue:work
that's circumventing normal behavior. Perhaps the queue worker could stop bybreak
'ing out of thewhile (true)
loop instead of exiting.Beta Was this translation helpful? Give feedback.
All reactions