Implement fixed node for token
All checks were successful
release-image / release-image (push) Successful in 2m4s
All checks were successful
release-image / release-image (push) Successful in 2m4s
This commit is contained in:
@@ -42,15 +42,19 @@ async def request_token_route():
|
||||
if not avail_ids:
|
||||
abort(404, "No available active Discord IDs found.")
|
||||
|
||||
# --- Logic for selecting a preferred ID based on client_id (TODO) ---
|
||||
selected_id = None
|
||||
# Check for any fixed IDs
|
||||
for avail_id in avail_ids:
|
||||
if avail_id.fixed_node and avail_id.fixed_node == client_id:
|
||||
selected_id = avail_id
|
||||
|
||||
if not selected_id:
|
||||
selected_id = avail_ids[0]
|
||||
|
||||
selected_id = avail_ids[0]
|
||||
print("Selected Discord ID: ", selected_id)
|
||||
current_app.active_clients[client_id].active_token = selected_id
|
||||
print(current_app.active_clients[client_id])
|
||||
|
||||
# --- End of logic for selecting a preferred ID ---
|
||||
|
||||
return jsonify(selected_id.to_dict())
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user