-
Notifications
You must be signed in to change notification settings - Fork 22
Likes not added to redis #10
Comments
This is an odd one. If you're saying it works sometimes, for some posts, but not other posts. Is there any pattern with the posts that cannot be liked? Perhaps certain id's that cannot be liked? I would recommend tailing the log to make sure that the initial post works to the controller
For some additional insight you can take a look at the result of by calling if that works every time, you can ensure the proper keys are being generated
If those look correct it is possible that your connection to redis is intermittent. You can try writing to redis directly
Let me know what the result of each of those tests are, and I can help trouble-shoot more. What version of Rails are you on? |
Hi Richard, Many thanks for your reply and help. Indeed, it is a very strange error: here's what I found after inspecting the elements you suggest:
So I guess everything works fine until here. Really strange error.. Only pattern I've noticed is that the first attempt to like/unlike always succeeds and every subsequent attempt always fails..And if I restart the server and try the same record it succeeds, it seems that the redis connection works only for the fist POST and then its gone! Just in case you spot any stupid mistakes:
|
Don't know if it helps, I'm running Rails v.3.0.10. I really have no idea where to start for debugging.. |
Hi Richard, I think my issue is the same as issue #11 opened by styx! I had not spotted this before, my 'unsuccessful' posts were sending in the correct resource id, however the target returned by find_by_resource_id is always the first post that is made (from when server started). Something funny could be going on in likeable / module_methods.rb and specifically in |
Thanks again for reporting this, i updated notes in #11. Should be fixed with Gem Version 0.1.1 |
Hi,
I'm developing a rails3 application using RedisToGo Nano as my development environment and a Mini instance in Heroku for production. I have closely followed the provided Likeable sample application and added the Likeable::UserMethods to my user model as well as the Likeable module to my posts model (and also added the likes_controller.rb, routes.rb, and like_helper.rb code as appropriate).
Problem is some likes are registered in redis and some are not at all! The bad ones do not create a key at all, meaning, after clicking the like link I run the REDIS.keys command and do not see anything relevant to the specific record.
I used the link tag provided in the posts index view in the sample application. Every time I click the link, the POST request is executed correctly, it includes "resource_name"=>"Post", "resource_id"=>"XX" in the parameters, and returns a 'Success' notice as it should in my view.
My only deviation from the sample application is in the setup of redis, I did:
in config/environments/development.rb:
and in config/initializers/redis.rb
Any ideas?
Many thanks for your help,
The text was updated successfully, but these errors were encountered: