Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle cache failures #16

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mogman1
Copy link

@mogman1 mogman1 commented Apr 22, 2023

Fixes warnings and specs, adds handling for upstream cache failure by falling back to RPC call. Also sets up github workflow to automatically run pipelines for multiple ruby / activesupport versions.

@mogman1 mogman1 force-pushed the handle_redis_failure branch 4 times, most recently from 8801dfd to 8ad3b32 Compare April 23, 2023 04:54
@mogman1 mogman1 changed the title Handle redis failure Handle cache failures Apr 28, 2023
@mogman1 mogman1 force-pushed the handle_redis_failure branch 4 times, most recently from 78ab837 to f33f858 Compare April 28, 2023 05:22
self[key]
end

def write(key, value)
def write(key, value, _options = nil)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated these to match signatures of Activesupport::Cache::Store

@@ -2,24 +2,24 @@

describe ::ActiveRemote::Cached::ArgumentKeys do
it "does not mutate a string by default" do
::ActiveRemote::Cached::ArgumentKeys.new("hello", {}).cache_key.must_equal("hello")
_(::ActiveRemote::Cached::ArgumentKeys.new("hello", {}).cache_key).must_equal("hello")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types of changes were made due to deprecation warnings from Minitest about calling methods like must_equal directly on objects.

@mogman1
Copy link
Author

mogman1 commented Apr 28, 2023

As a note, I'd definitely prefer to publish a release candidate version of this first to do extra validation. Things worked as I expected testing locally, but abundance of caution and all that.

lib/active_remote/cached.rb Outdated Show resolved Hide resolved
@film42
Copy link

film42 commented May 1, 2023

LGTM

Copy link

@film42 film42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants