perf(startup): skip inactive background services
This commit is contained in:
@@ -2,7 +2,6 @@ import { NextResponse } from "next/server";
|
||||
import { getSettings, updateSettings } from "@/lib/localDb";
|
||||
import { applyOutboundProxyEnv } from "@/lib/network/outboundProxy";
|
||||
import { resetComboRotation } from "open-sse/services/combo.js";
|
||||
import { runQuotaAutoPingTick } from "@/shared/services/quotaAutoPing";
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -101,10 +100,12 @@ export async function PATCH(request) {
|
||||
Object.prototype.hasOwnProperty.call(body, "claudeAutoPing") ||
|
||||
Object.prototype.hasOwnProperty.call(body, "codexAutoPing")
|
||||
) {
|
||||
// Run once immediately after opt-in changes so users don't wait for the next scheduler tick.
|
||||
runQuotaAutoPingTick().catch((error) => {
|
||||
console.warn("[AutoPing] settings-triggered tick failed:", error.message);
|
||||
});
|
||||
// Keep the scheduler absent when no account opted in; load its provider graph only on demand.
|
||||
import("@/shared/services/quotaAutoPing")
|
||||
.then(({ configureQuotaAutoPing }) => {
|
||||
configureQuotaAutoPing(settings);
|
||||
})
|
||||
.catch((error) => console.warn("[AutoPing] settings update failed:", error.message));
|
||||
}
|
||||
|
||||
const { password, oidcClientSecret, ...safeSettings } = settings;
|
||||
|
||||
Reference in New Issue
Block a user