Comments (10)
sounds like it's trying to cache a thread? that doesn't make a lot of sense... maybe more debug needed? what happens if you run without the block?
from dalli.
Hi, if I don't use "Rails.cache.fetch" and use just "active_deal" everything works.
from dalli.
What if you just use fetch without the block? Would help to pinpoint the issue.
from dalli.
Sorry but I don't know what you mean.
This does not work at all:
Rails.cache.fetch('all_active_deals', :expires_in => 10.minutes) active_deal
from dalli.
drop the active_deal and just use
Rails.cache.fetch('all_active_deals').
It obviously won't return anything if there is nothing stored already, but this would show if it is a Dalli issue or an issue with what you are trying to cache.
from dalli.
Just like you say it returns nothing. The dalli cache is working, I do have some fragments that I cache and there is no problem with it.
The mysterious thing is, that the error message from above just started showing as I switched to dalli. memcached-northscale worked but it doesn't run under Rails3 that why I switched to dalli.
from dalli.
so in rails console do something like
deals = active_deal
Rails.cache.write('all_active_deals', deals)
if that works, run
Rails.cache.fetch('all_active_deals')
and see what fails.
from dalli.
As plukevdh points out, your code is trying to cache a Thread instance, which does not work. Whatever active_deal returns, it contains a reference to a Thread somewhere.
from dalli.
I really don't know if there is a thread instance, I have to check it though.
@plukevdh: The cache.write fails. So it really looks like a thread problem. Like I said I have to check it.
Thanks guys.
from dalli.
Ok, after a lot of testing I found that I cannot store my named-scope in the cache.
Like I said, the mysterious thing is that it worked before with memcached-northscale. But like mperham pointed out - dalli cache works a bit different.
I will use fragment caching then.
Thanks.
from dalli.
Related Issues (20)
- All servers are eagerly flushed at the end of a multi block
- Unable to connect to a dragonfly memcache instance HOT 2
- Performance loss when upgrading from Dalli 2.7.10 to 3.2.2 HOT 5
- Question: Session cookies with Dalli HOT 1
- Meta protocol flush_all method is vulnerable to code injection (Lack of input type check) HOT 7
- Behavior around clear
- Hanging when performing read_multi against large number of keys HOT 4
- DalliError: Response error 6: Incr/decr on a non-numeric value HOT 2
- Dalli sometimes returns incorrect values HOT 18
- Loss of Connections after upgrading to dalli 3.2.3 HOT 3
- `cache_nils` vs `skip_nil` HOT 3
- No request in progress HOT 2
- IO::TimeoutError exceptions are not handled, breaking automatic retry HOT 4
- connection_pool gem is required HOT 11
- Ruby 3.3: warning related to base64 missing in the gemspec
- TypeError: no implicit conversion of Hash into String HOT 27
- Add TruffleRuby to CI? HOT 2
- 3.2.7 tagged logging issue HOT 1
- TypeError raised in latest Socksify when initializing Dalli client with version 3.2.7+ HOT 4
- Should I react to the "Fork detected, re-connecting child process" exception? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dalli.