Open franciscomasi opened 5 years ago
You should be able to force a reload.
@mhgbrown do you think the gem should handle this? if nil, attempt a reload.
@Daniel-ltw hmm, this is a good q. Perhaps it can be an option? In combination with like a max_retries or something?
@franciscomasi does forcing a reload solve your problem for now?
@Daniel-ltw @mhgbrown In principle it is a good alternative solution. I should modify the MyActiveResource class in some way so that, in case the result is null, try at least one more time using the recharge. Otherwise, I should include in each call a validation for the recharge, which leads me to modify many lines of code in many applications.
Ok, gotcha. You want to maybe submit a PR @franciscomasi 😉😎? Otherwise, @Daniel-ltw or I can hopefully make some time to check it out...
Hello! I have problems with cached_resource because when a resource is not found, the cache is updated with the error. For example when execute
MyActiveResource.first
, this return http status code 404 and cache is updated with nil. If i run againMyActiveResource.first
, the cache return nil. Is it correct that before an error the cache is updated?