Closed s1rc closed 3 years ago
what cache driver do you use?
Redis.
This happens as totem register his task to the scheduler in every app bootstrap, and not only in Console Kernel. Here is my Pull Request for this.
Added new PR for that specific frequencies query https://github.com/codestudiohq/laravel-totem/pull/302
@o-kima awesome thank you. Hopefully your PRs can be reviewed soon.
@s1rc New release with update from @o-kima https://github.com/codestudiohq/laravel-totem/releases/tag/v8.3.0
@qschmick thank you!
Testing this out, I see the Redis cache hits on every request. This is more ideal than querying the DB, is there a way to register the task in only the console kernel?
Please add more details like what cache key it search and where it occurs in the flow. I just retested it in my app, listening to CacheHit|CacheMissed, no requests found in HTTP kernel.
Fixed at commit https://github.com/codestudiohq/laravel-totem/pull/299/commits/65c8e3d3e6eb2cf22c267f2388755ae587f709da
Looking at Telescope, even on requests with no queries aside from session these are run:
get app_cache:totem.tasks.active
get app_cache:totem.table.totem_tasks
Edit: I added a listener to EventServiceProvider
for Illuminate\Cache\Events\CacheHit
in case Telescope was mis-reporting. Both those are returning hits from every request.
Every request made outside of Totem routes still has totem queries such as:
and
Is there a reason these queries and cache hits are running on all requests?