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

Fix an issue with redis keys not hitting #1043

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joegaudet
Copy link
Contributor

When writing to a redis store, the keys used by JR are converted to
slash delimited strings. So:

key = [record_type, id, updated at]

Gets converted to record_type/id/updated_at

This causes the lookup function to never get hits from the redis store.

This commit adds a configurable function to allow formating of the
lookup key.

When writing to a redis store, the keys used by JR are converted to
slash delimited strings. So:

key = [record_type, id, updated at]

Gets converted to record_type/id/updated_at

This causes the lookup function to never get hits from the redis store.

This commit adds a configurable function to allow formating of the
lookup key.
@joegaudet joegaudet force-pushed the bugfix/support-key-formating branch from 3a96c49 to 98646ed Compare April 21, 2017 19:49
@DavidMikeSimon
Copy link
Contributor

@joegaudet This particular issue with redis has been reported before in #917, and I wasn't able to reproduce it. Can you tell me more about your environment, e.g. Ruby version, name and version of redis gem used?

@joegaudet
Copy link
Contributor Author

@DavidMikeSimon Gems:

gem 'redis-rails', '> 4.0.0' # Rails Redis adapters, caching, sessions, etc.
gem 'redis-namespace', '
> 1.5.0' # namespacing for Redis
gem 'rails', '~> 4.2.0'

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

So the issue seems to be in the way things get written to redis, our keys looks like this:

orders/321/2017-04-26 23:52:58 UTC/SRLZ-sZHh1BNSdDAaht97RdKB23JJ8+D5bQpy28pQdI5xFhg=/ATTR-CTX-k_+raGkUaGivBBbrqmIyPlG3wldRXXdUeNbg1_d37K0=

record-type/record-id/updated-at/hash

Where the JR system appears to use an array as the key.

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.

2 participants