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
Configuration in readme file is really confusing and doesn't work for me:
config.identity_cache_store=:memcached_store,Memcached::Rails.new(servers: memcached_hosts,support_cas: true,auto_eject_hosts: false,# avoids more cache consistency issuesexpires_in: 6.hours.to_i,# in case of network errors when sending a delete)
Returns this error:
.rvm/gems/ruby-2.5.7/gems/memcached-1.8.0/lib/memcached/memcached.rb:115:in `block in initialize': :expires_in is not a valid configuration parameter. (ArgumentError)
Looking at the source code of memcached, correct parameter is default_ttl, using this config:
config.identity_cache_store=:memcached_store,Memcached::Rails.new(servers: memcached_hosts,support_cas: true,auto_eject_hosts: false,# avoids more cache consistency issuesdefault_ttl: 6.hours.to_i,# in case of network errors when sending a delete)
then gives this error:
.rvm/gems/ruby-2.5.7/gems/memcached_store-2.1.4/lib/active_support/cache/memcached_store.rb:71:in `initialize': Memcached::Rails is no longer supported, use a Memcached instance instead (RuntimeError)
On some other issues #211 and the source code of IdentityCache itself in test/helpers/cache_connection.rb I saw that ActiveSupport::Cache::MemcachedStore.new is used:
config.identity_cache_store=:memcached_store,ActiveSupport::Cache::MemcachedStore.new("127.0.0.1:11211",support_cas: true,auto_eject_hosts: false,# avoids more cache consistency issuesdefault_ttl: 6.hours.to_i,# in case of network errors when sending a delete)
throws this error: (using servers: ["127.0.0.1:11211"] doesn't work either)
.rvm/gems/ruby-2.5.7/gems/memcached-1.8.0/lib/memcached/memcached.rb:209:in `block in set_servers': Servers must be either in the format 'host:port[:weight]' (e.g., 'localhost:11211' or 'localhost:11211:10') for a network server, or a valid path to a Unix domain socket (e.g., /var/run/memcached). (ArgumentError)
This config works for me, note that using servers: named parameter also doesn't work:
config.identity_cache_store=:memcached_store,Memcached.new(memcached_hosts,# ["127.0.0.1:11211"]support_cas: true,auto_eject_hosts: false,# avoids more cache consistency issuesdefault_ttl: 6.hours.to_i,# in case of network errors when sending a delete)
Is this correct and Readme file outdated or am I missing something here?
I'm using identity_cache 1.0.1 with Rails 6.0.2.2.
The text was updated successfully, but these errors were encountered:
Configuration in readme file is really confusing and doesn't work for me:
Returns this error:
.rvm/gems/ruby-2.5.7/gems/memcached-1.8.0/lib/memcached/memcached.rb:115:in `block in initialize': :expires_in is not a valid configuration parameter. (ArgumentError)
Looking at the source code of memcached, correct parameter is
default_ttl
, using this config:then gives this error:
.rvm/gems/ruby-2.5.7/gems/memcached_store-2.1.4/lib/active_support/cache/memcached_store.rb:71:in `initialize': Memcached::Rails is no longer supported, use a Memcached instance instead (RuntimeError)
On some other issues #211 and the source code of IdentityCache itself in
test/helpers/cache_connection.rb
I saw thatActiveSupport::Cache::MemcachedStore.new
is used:throws this error: (using
servers: ["127.0.0.1:11211"]
doesn't work either)This config works for me, note that using
servers:
named parameter also doesn't work:Is this correct and Readme file outdated or am I missing something here?
I'm using identity_cache 1.0.1 with Rails 6.0.2.2.
The text was updated successfully, but these errors were encountered: