Giter VIP home page Giter VIP logo

Comments (10)

plukevdh avatar plukevdh commented on July 22, 2024

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.

mobilutz avatar mobilutz commented on July 22, 2024

Hi, if I don't use "Rails.cache.fetch" and use just "active_deal" everything works.

from dalli.

plukevdh avatar plukevdh commented on July 22, 2024

What if you just use fetch without the block? Would help to pinpoint the issue.

from dalli.

mobilutz avatar mobilutz commented on July 22, 2024

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.

plukevdh avatar plukevdh commented on July 22, 2024

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.

mobilutz avatar mobilutz commented on July 22, 2024

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.

plukevdh avatar plukevdh commented on July 22, 2024

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.

mperham avatar mperham commented on July 22, 2024

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.

mobilutz avatar mobilutz commented on July 22, 2024

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.

mobilutz avatar mobilutz commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.