spatie / laravel-short-schedule

Schedule artisan commands to run at a sub-minute frequency
https://freek.dev/1683-a-package-to-schedule-artisan-commands-at-sub-minute-frequencies
MIT License
611 stars 52 forks source link

Clear cache/mutex feature missing #72

Closed AshishMehraSense closed 1 year ago

AshishMehraSense commented 1 year ago

Hello there,

Thank you for creating short-schedule, this has been a great help to me and my team!

I recently noticed something strange in my error logs - it seems that after deleting a scheduled command sometime ago, it still seems to be cached to run every 30secs and now it generates this error:

[2023-01-11 12:12:04] development.ERROR: Command "websocket:send_data" is not defined.

Did you mean one of these?
    websocket:send_new_data
    websocket:send_old_data
    websockets:clean
    websockets:restart
    websockets:serve {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"websocket:send_data\" is not defined. 

The send_data command was replaced by two other commands (send_old_data and send_new_data) a couple of months ago and as everything was running fine I didn't look at the logs until recently when I was performing some housekeeping. So I've been getting this error every 30 secs for quite some time now and I have narrowed it down to this been a cache/mutex issue.

If you see here: https://github.com/laravel/framework/pull/40135/files, a command schedule:clear-cache was created by [bernardwiesner] and was later merged in by Taylor into the Laravel Framework itself as it was created to clear the cache/mutex for the regular Laravel Scheduler.

I believe your plugin needs the same as I have tried all other ways to clear caches and all sorts of things but this one error just won't go away and it is definitely not being called in the codebase anywhere.

Here are all the commands I've tried in order to clear any remains of any old code/cache/mutex from Laravel and the above issue still persists.

php artisan optimize:clear && php artisan config:clear && php artisan config:cache && php artisan cache:clear && php artisan auth:clear-resets && php artisan route:clear && php artisan route:cache && php artisan view:clear && php artisan view:cache && php artisan event:clear && php artisan event:cache &&  php artisan schedule:clear-cache

redis-cli FLUSHDB

php artisan websockets:clean && php artisan websockets:restart

php artisan horizon:purge && php artisan horizon:terminate && php artisan horizon:publish && php artisan queue:flush && php artisan queue:clear && php artisan queue:restart

Thank you for your help in advance!