Skip to content

Instantly share code, notes, and snippets.

@hobodave
Created April 22, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hobodave/f1587f15406ac1ca5430599213e587b1 to your computer and use it in GitHub Desktop.
Save hobodave/f1587f15406ac1ca5430599213e587b1 to your computer and use it in GitHub Desktop.
Rails.cache.fetch(cache_key, expires_in: expires_in, race_condition_ttl: 7.days.to_i)
# JRuby 9.0.5.0, Rails 4.1.13
# ConcurrencyError: Detected invalid hash contents due to unsynchronized modifications with concurrent users
# .org/jruby/RubyMarshal.java:102:in `dump'(undefined
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 669:in `dup_value!'
# …upport-4.1.13/lib/active_support/cache/memory_store.rb: 146:in `write_entry'
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 571:in `handle_expired_entry'
# …/gems/activesupport-4.1.13/lib/active_support/cache.rb: 291:in `fetch'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment