예제 #1
0
 def _save(self):
     self.version = str(time())
     data = {
             'version': self.version,
             'queue': self._queue,
             }
     store.timeout_store(self._key, data, config.PARTY_EXPIRE_TIMEOUT)
예제 #2
0
 def _save(self):
     self.version = str(time())
     data = {
         'version': self.version,
         'queue': self._queue,
     }
     store.timeout_store(self._key, data, config.PARTY_EXPIRE_TIMEOUT)
예제 #3
0
 def vote(self, user, track_uri):
     user_vote_key = 'vote:%s:%s' % (
         user,
         track_uri,
     )
     if user_vote_key not in store:
         self._queue.vote(track_uri)
         store.timeout_store(user_vote_key, 1, config.USER_REPEAT_VOTE_WAIT)
예제 #4
0
def create():
    party_id = create_id(size=5)
    key = 'party:%s' % (party_id, )
    store.timeout_store(key, 1, config.PARTY_JOIN_TIMEOUT)
    return party_id, [], '0'
예제 #5
0
def create():
    party_id = create_id(size=5)
    key = 'party:%s' % (party_id,)
    store.timeout_store(key, 1, config.PARTY_JOIN_TIMEOUT)
    return party_id, [], '0'
예제 #6
0
 def vote(self, user, track_uri):
     user_vote_key = 'vote:%s:%s' % (user, track_uri,)
     if user_vote_key not in store:
         self._queue.vote(track_uri)
         store.timeout_store(user_vote_key, 1, config.USER_REPEAT_VOTE_WAIT)