feat: add round-robin routing strategy

Implements a round-robin (least recently used) account selection strategy
alongside the existing fill-first priority system. Adds a toggle in the
Profile dashboard to switch between strategies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Catalin Stanciu
2026-01-09 17:25:28 +07:00
committed by decolua
co-authored by Claude Sonnet 4.5
parent 9c3d6f4ad8
commit 9ebd7d3062
3 changed files with 91 additions and 5 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { getSettings } from "@/lib/localDb";
import { getSettings, updateSettings } from "@/lib/localDb";
export async function GET() {
try {
@@ -10,3 +10,14 @@ export async function GET() {
return NextResponse.json({ error: error.message }, { status: 500 });
}
}
export async function PATCH(request) {
try {
const body = await request.json();
const settings = await updateSettings(body);
return NextResponse.json(settings);
} catch (error) {
console.log("Error updating settings:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
}
}