def _save(self): self.version = str(time()) data = { 'version': self.version, 'queue': self._queue, } store.timeout_store(self._key, data, config.PARTY_EXPIRE_TIMEOUT)
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)
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'
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'
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)