mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-05-13 16:07:30 +00:00
🪙 fix: Pass appConfig to getBalanceConfig in set-balance script (#13070)
`config/set-balance.js` calls `getBalanceConfig()` without an argument, so it cannot read the parsed `balance` section from librechat.yaml. As a result the script always errors with "Balance is not enabled. Use librechat.yaml to enable it" — even when balance is enabled. `config/add-balance.js` already follows the correct pattern (fetch `appConfig` via `getAppConfig()` and pass it into `getBalanceConfig`), introduced in #9234. This applies the same pattern to set-balance.js. Co-authored-by: Odrec <Odrec@users.noreply.github.com>
This commit is contained in:
parent
0449c423a2
commit
0f59cd79dd
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ const { User, Balance } = require('@librechat/data-schemas').createModels(mongoo
|
|||
require('module-alias')({ base: path.resolve(__dirname, '..', 'api') });
|
||||
const { askQuestion, silentExit } = require('./helpers');
|
||||
const connect = require('./connect');
|
||||
const { getAppConfig } = require('~/server/services/Config');
|
||||
|
||||
(async () => {
|
||||
await connect();
|
||||
|
|
@ -31,7 +32,8 @@ const connect = require('./connect');
|
|||
// console.purple(`[DEBUG] Args Length: ${process.argv.length}`);
|
||||
}
|
||||
|
||||
const balanceConfig = getBalanceConfig();
|
||||
const appConfig = await getAppConfig();
|
||||
const balanceConfig = getBalanceConfig(appConfig);
|
||||
if (!balanceConfig?.enabled) {
|
||||
console.red('Error: Balance is not enabled. Use librechat.yaml to enable it');
|
||||
silentExit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue