You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey @rameerez, nice gem! I especially like the DSL 🙌🏼
I saw that so far, the timestamps (e.g. last_run) are stored using a cache. This can be problematic for example when you run Sidekiq in a different process. Unless the app uses a shared cache between the processes, the last_run can't be updated within the worker.
the use case:
I have a Rails app and a separate worker (different process) for Sidekiq.
I then want to monitor the health of the process running in the worker
solutions I can come up with:
a) use a shared cache (solid_cache -> db-backed, redis_cache_store, ...)
b) patch the configuration layer to persist the timestamps with a db
a) is already possible. One can simply override the cache_store config.
b) requires a work around.
-> it would be nice if the persistence strategy is configurable. I imagine it as follows: config.all_good.store = :db or config.all_good.store = :cache
with :cache it would use the existing cache_store class. with a :db setting, it could work as follows:
classHealthCheck < ApplicationRecordbefore_create:ensure_singularityvalidates:last_run,presence: truedefself.instancefirst_or_create!(last_run: Time.current)endprivatedefensure_singularityraiseStandardError,'There can be only one instance'ifHealthCheck.any?endend
this would require an abstraction of the store
The text was updated successfully, but these errors were encountered:
hey @rameerez, nice gem! I especially like the DSL 🙌🏼
I saw that so far, the timestamps (e.g.
last_run
) are stored using a cache. This can be problematic for example when you run Sidekiq in a different process. Unless the app uses a shared cache between the processes, thelast_run
can't be updated within the worker.the use case:
solutions I can come up with:
a) use a shared cache (
solid_cache
-> db-backed,redis_cache_store
, ...)b) patch the configuration layer to persist the timestamps with a db
a) is already possible. One can simply override the
cache_store
config.b) requires a work around.
-> it would be nice if the persistence strategy is configurable. I imagine it as follows:
config.all_good.store = :db
orconfig.all_good.store = :cache
with
:cache
it would use the existingcache_store
class. with a:db
setting, it could work as follows:this would require an abstraction of the store
The text was updated successfully, but these errors were encountered: