コード例 #1
0
ファイル: message.py プロジェクト: geraldoandradee/VoterChat
def send_users(msg_id, users):
    """
    Send a list of users a message.
    """
    r.set("msg:%s:count" % msg_id, len(users))
    for username in users:
        user.send(username, msg_id)
コード例 #2
0
ファイル: message.py プロジェクト: geraldoandradee/VoterChat
def send_users(msg_id, users):
    """
    Send a list of users a message.
    """
    r.set("msg:%s:count" % msg_id, len(users))
    for username in users:
        user.send(username, msg_id)
コード例 #3
0
ファイル: models.py プロジェクト: motoom/VoterChat
 def send_users(self, users):
     """
     Send a list of users the message.
     """
     r.set("%s:count" % self.key, len(users))
     for username in users:
         user = User(username)
         user.load()
         user.send(self.id)
コード例 #4
0
ファイル: models.py プロジェクト: lobiCode/VoterChat
 def send_users(self, users):
     """
     Send a list of users the message.
     """
     r.set("%s:count" % self.key, len(users))
     for username in users:
         user = User(username)
         user.load()
         user.send(self.id)
コード例 #5
0
ファイル: models.py プロジェクト: motoom/VoterChat
def flushdb():
    """
    Prepare the database to store users.
    """
    r.set("message_last_id", 0)
コード例 #6
0
ファイル: message.py プロジェクト: geraldoandradee/VoterChat
def flushdb():
    r.set("msg_counter", 0)
コード例 #7
0
ファイル: models.py プロジェクト: lobiCode/VoterChat
def flushdb():
    """
    Prepare the database to store users.
    """
    r.set("message_last_id", 0)    
コード例 #8
0
ファイル: message.py プロジェクト: geraldoandradee/VoterChat
def flushdb():
    r.set("msg_counter", 0)
コード例 #9
0
ファイル: auth_handler.py プロジェクト: ali-mahdian/library
def signJWT(user_id: int, role: str):
    payload = {"id": user_id, "role": role}
    token = jwt.encode(payload, JWT_SECRET, algorithm=JWT_ALGORITHM)
    r.set(token, user_id)
    return token