Example #1
0
    def start_senders(self):

        offset = 0
        length = 50
        user_chunk = get_users(offset, length)
        while len(user_chunk) > 0:

            worker_thread = SenderWorker(user_chunk)
            worker_thread.start()
            self.threads.append(worker_thread)

            offset += length
            user_chunk = get_users(offset, length)

        for thread in self.threads:
            thread.join()
Example #2
0
def user_list():
    user = get_jwt_identity()
    if user["group"] != "admin":
        return jsonify({"error": "Only admin can access this endpoint"}), 403

    users = get_users()
    return jsonify(users)
def user_info():
    with DatabaseManager() as db:
        users = user.get_users(db.conn)

    return jsonify(users)