mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 08:17:11 +00:00
fix(cliproxy): address sync review feedback
- Fix auto_sync JSDoc to say (default: true) matching actual default - Add unlink event handler for profile deletion sync - Add debug logging for sync failures in api-command
This commit is contained in:
@@ -130,6 +130,7 @@ export function startAutoSyncWatcher(): void {
|
|||||||
|
|
||||||
watcherInstance.on('change', onFileChange);
|
watcherInstance.on('change', onFileChange);
|
||||||
watcherInstance.on('add', onFileChange);
|
watcherInstance.on('add', onFileChange);
|
||||||
|
watcherInstance.on('unlink', onFileChange);
|
||||||
|
|
||||||
watcherInstance.on('error', (error) => {
|
watcherInstance.on('error', (error) => {
|
||||||
log(`Watcher error: ${error.message}`);
|
log(`Watcher error: ${error.message}`);
|
||||||
|
|||||||
@@ -277,8 +277,13 @@ async function handleCreate(args: string[]): Promise<void> {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger sync to local CLIProxy config (best-effort, ignore result)
|
// Trigger sync to local CLIProxy config (best-effort)
|
||||||
syncToLocalConfig();
|
try {
|
||||||
|
syncToLocalConfig();
|
||||||
|
} catch (err) {
|
||||||
|
const message = err instanceof Error ? err.message : 'Unknown error';
|
||||||
|
console.log(`[i] Auto-sync to CLIProxy config skipped: ${message}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Display success
|
// Display success
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export interface CLIProxyConfig {
|
|||||||
auth?: CLIProxyAuthConfig;
|
auth?: CLIProxyAuthConfig;
|
||||||
/** Background token refresh worker settings */
|
/** Background token refresh worker settings */
|
||||||
token_refresh?: TokenRefreshSettings;
|
token_refresh?: TokenRefreshSettings;
|
||||||
/** Auto-sync API profiles to local CLIProxy config on settings change (default: false) */
|
/** Auto-sync API profiles to local CLIProxy config on settings change (default: true) */
|
||||||
auto_sync?: boolean;
|
auto_sync?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user