Implement fixed node for token
All checks were successful
release-image / release-image (push) Successful in 2m4s

This commit is contained in:
Logan Cusano
2025-06-29 19:08:57 -04:00
parent df4e7f7d67
commit f2dd714571
2 changed files with 14 additions and 5 deletions

View File

@@ -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: