feat(billing): make metering formula admin-configurable
Memind CI / Test, build, and release guards (pull_request) Failing after 1m29s
Memind CI / Test, build, and release guards (pull_request) Failing after 1m29s
Allow margin/FX/cost-mode knobs to be overridden via h5_billing_admin_config so memind_adm can adjust DeepSeek billing without editing env. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-1
@@ -142,6 +142,7 @@ export function createUserAuth(pool, options = {}) {
|
||||
? options.provisionUserDataSpace
|
||||
: null;
|
||||
const getMindSearchConfig = typeof options.getMindSearchConfig === 'function' ? options.getMindSearchConfig : null;
|
||||
const billingConfigService = options.billingConfigService ?? null;
|
||||
const sessions = new Map();
|
||||
const loginFailures = new Map();
|
||||
|
||||
@@ -1334,7 +1335,9 @@ export function createUserAuth(pool, options = {}) {
|
||||
};
|
||||
}
|
||||
const tokenState = normalizeTokenState(tokenStateRaw);
|
||||
const config = loadBillingConfig();
|
||||
const config = billingConfigService?.getEffectiveBillingConfig
|
||||
? await billingConfigService.getEffectiveBillingConfig()
|
||||
: loadBillingConfig(env);
|
||||
const normalizedRequestId = requestId ? String(requestId).trim() || null : null;
|
||||
const now = Date.now();
|
||||
const conn = await pool.getConnection();
|
||||
|
||||
Reference in New Issue
Block a user