Replies: 2 comments
-
To detect |
Beta Was this translation helpful? Give feedback.
-
Thanks for the input, @crynobone! Does the situation change if the command is executed by the scheduler and killed with i.e the If that's not feasible, I was thinking about implementing a time-based check (limited to development) to identify any dead processes and their locks, then clean up the ghost locks accordingly. Thanks, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.48.22
PHP Version
8.3.13
Database Driver & Version
Postgress
Description
I've been working with commands that require the
--isolated
option to ensure they run exclusively. However, there is something that feels inconsistent when it comes to lock removal:When an exception is thrown within the command, Laravel correctly removes the lock from the cache (using Redis in my case).
But if the process is manually terminated (e.g., with Ctrl+C), the lock remains in Redis and has to be manually cleared before the command can be run again.
I’m looking for guidance on the best approach to ensure that the lock is removed from the cache regardless of how the command is terminated. Ideally, I’d like to avoid using a time-based release, as I need the lock to persist only until the command truly finishes.
I also wanted to add that
artisan schedule:clear-cache
does not cleare mentioned locks.Would appreciate any suggestions or best practices on this. Thanks!
Steps To Reproduce
--isolated
option.Beta Was this translation helpful? Give feedback.
All reactions