mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 22:14:22 +00:00
fix(proxy): ignore legacy singleton session file
This commit is contained in:
1 parent
24c24847f7
commit
f345cf441e
2 files changed
+47
-2
No files matched your search
@@ -108,10 +108,18 @@ export function listOpenAICompatProxyProfileNames(): string[] {
|
||||
const entries = fs.readdirSync(getOpenAICompatProxyDir(), { withFileTypes: true });
|
||||
const profileKeys = new Set<string>();
|
||||
for (const entry of entries) {
|
||||
if (!entry.isFile() || !entry.name.endsWith('.session.json')) {
|
||||
if (
|
||||
!entry.isFile() ||
|
||||
entry.name === 'session.json' ||
|
||||
!entry.name.endsWith('.session.json')
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
profileKeys.add(entry.name.slice(0, -'.session.json'.length));
|
||||
const profileKey = entry.name.slice(0, -'.session.json'.length);
|
||||
if (!profileKey) {
|
||||
continue;
|
||||
}
|
||||
profileKeys.add(profileKey);
|
||||
}
|
||||
return [...profileKeys].map((profileKey) => decodeURIComponent(profileKey));
|
||||
} catch {
|
||||
|
||||
Reference in new issue
Block a user