-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong insertion into followers feed? #16
Comments
Hi ! The global name is used for the storing the activity. (mapping the id to the activity) So its normal for data to end up in global. The feedly setup looks ok. I see two possible reasons why there is nothing in feed:normal A.) the list of follower ids returned is empty (You could try enabling What sort of application are you building? Best of luck! |
Hi!:) Im building a social gift-planner/wishlist-app! Im trying to integrate feedly so that I can make REST-based feeds on the form "User1 added product1 to wishlist1" :) So what i would need is that other users (User1's friends) can receive this kind of feed. Current settings.py: BROKER_URL = 'redis://127.0.0.1:6379/0' I will check get_user_follower_ids() for emptiness (I am pretty certain that the friend-relationships exists in the database though). I would need something that works in production also :) |
Sounds cool, Celery is a great for running async tasks, but it can be a bit of a learning curve. Try to verify that the code reaches |
I think there might be a problem with my redis setup as well, I've On Wed, Dec 18, 2013 at 12:33 PM, Thierry Schellenbach <
Mvh Andreas Røed |
when CELERY_ALWAYS_EAGER is set to True tasks are executed in the same 2013/12/18 Andreas Røed notifications@github.com
|
So I got it working correctly when using CELERY_ALWAYS_EAGER = True ! :) On Wed, Dec 18, 2013 at 1:49 PM, Tommaso Barbugli
Mvh Andreas Røed |
Thats because tasks are waiting in the broker to be consumed by a celery
|
So this should be closed? |
Hi!
I manage to get the get_user_feed() work properly, but when I try to fetch followers feeds, something strange happens. I think it might be an issue connected to fanout/insertion into feedly: Ive used the pin_feedly example as a starting point.
Here is some code:
models.py:
Test implementation of feedly:
class WishFeed(RedisFeed):
key_format = 'feed:normal:%(user_id)s'
class UserWishFeed(WishFeed):
key_format = 'feed:user:%(user_id)s'
class UserWishFeedly(Feedly):
feed_classes = dict(
normal=WishFeed,
)
views.py
@csrf_exempt
@api_view(['GET'])
@login_required
def friends_wish_feed(request, _args, *_kwargs):
feed = feedly.get_feeds(request.user.id)['normal']
act_list = []
json_data = []
for acts in feed[:25]:
act_list.append(acts)
json_data = json.dumps(act_list)
return Response(json_data)
this is how I insert into the feeds:
views.py
...
activity = Activity(wishlist.user,WishVerb,in_prod.id)
feed = UserWishFeed(wishlist.user.id)
feed.add(activity)
feedly.add_wish(wishlist.user, activity)
...
from redis-cli after insertion i will get this:
127.0.0.1:6379> keys *
if i query 3) :
127.0.0.1:6379> zrange "feed:user:7" 0 1
127.0.0.1:6379> hgetall "global:3"
Seems like the insertion went fine, except that it did not define the correct key_format?
How can I fix this?
Why does it say "global:" instead of "user:normal:" like I defined in WishFeed(RedisFeed) ?
The function friends_wish_feed() returns [] every time..
Help appreciated!! :)
The text was updated successfully, but these errors were encountered: