示例#1
0
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
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
 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
 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
def flushdb():
    """
    Prepare the database to store users.
    """
    r.set("message_last_id", 0)
示例#6
0
def flushdb():
    r.set("msg_counter", 0)
示例#7
0
def flushdb():
    """
    Prepare the database to store users.
    """
    r.set("message_last_id", 0)    
示例#8
0
def flushdb():
    r.set("msg_counter", 0)
示例#9
0
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