Esempio n. 1
0
    def get(self,user_id):
        feed_time_meta = redis.hgetall(FEED_UPDATE_TIME_KEY % {'user_id':user_id})
        try:
            last_update_time = int(feed_time_meta.get('last_update_time'))
        except:
            last_update_time = int(time.time())

        last_update_time = datetime.fromtimestamp(last_update_time)
        res = backend.get_new_feed(user_id,last_update_time)
        return jsonify(has_new=res)
Esempio n. 2
0
    def get(self, user_id):
        activity_time_meta = redis.hgetall(ACTIVITY_UPDATE_TIME_KEY % {"user_id": user_id})
        try:
            last_update_time = int(activity_time_meta.get("last_update_time"))
        except:
            last_update_time = int(time.time())

        last_update_time = datetime.fromtimestamp(last_update_time)
        count = backend.get_new_activity_count(user_id, last_update_time)

        return jsonify(count=count)
Esempio n. 3
0
    def get(self, user_id):
        feed_time_meta = redis.hgetall(FEED_UPDATE_TIME_KEY %
                                       {'user_id': user_id})
        try:
            last_update_time = int(feed_time_meta.get('last_update_time'))
        except:
            last_update_time = int(time.time())

        last_update_time = datetime.fromtimestamp(last_update_time)
        res = backend.get_new_feed(user_id, last_update_time)
        return jsonify(has_new=res)
Esempio n. 4
0
    def get(self,user_id):
        activity_time_meta = redis.hgetall(ACTIVITY_UPDATE_TIME_KEY % \
                                    {'user_id':user_id})
        try:
            last_update_time = int(activity_time_meta.get('last_update_time'))
        except:
            last_update_time = int(time.time())

        last_update_time = datetime.fromtimestamp(last_update_time)
        count = backend.get_new_activity_count(user_id,last_update_time)

        return jsonify(count=count)