bugfix
This commit is contained in:
@@ -64,9 +64,7 @@ async function handleStreamMessage(message: StreamMessage, vfs: VirtualFileSyste
|
|||||||
case 'reset': {
|
case 'reset': {
|
||||||
const reset: ResetPayload = JSON.parse(message.payload);
|
const reset: ResetPayload = JSON.parse(message.payload);
|
||||||
logger.info(`Processing reset event: ${reset.action}`);
|
logger.info(`Processing reset event: ${reset.action}`);
|
||||||
|
await vfs.resetAndReload();
|
||||||
vfs.reset();
|
|
||||||
logger.info('VFS reset complete, awaiting new file updates');
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,26 @@ export class VirtualFileSystem {
|
|||||||
logger.info('VFS reset complete - awaiting new file updates from meta-sort');
|
logger.info('VFS reset complete - awaiting new file updates from meta-sort');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the VFS and immediately reload from Redis
|
||||||
|
* Called when meta-sort triggers a fresh scan (reset event)
|
||||||
|
* Unlike reset(), this method immediately repopulates from Redis keys.
|
||||||
|
*/
|
||||||
|
async resetAndReload(): Promise<void> {
|
||||||
|
const startTime = Date.now();
|
||||||
|
logger.info('Resetting VFS and reloading from Redis...');
|
||||||
|
|
||||||
|
// Clear the VFS
|
||||||
|
this.initRoot();
|
||||||
|
this.lastRefresh = null;
|
||||||
|
|
||||||
|
// Immediately reload from Redis keys
|
||||||
|
await this.refresh();
|
||||||
|
|
||||||
|
const elapsed = Date.now() - startTime;
|
||||||
|
logger.info(`VFS reset and reload complete: ${this.cachedStats.fileCount} files in ${elapsed}ms`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refresh the VFS from Redis
|
* Refresh the VFS from Redis
|
||||||
* Called once on startup for initial bootstrap.
|
* Called once on startup for initial bootstrap.
|
||||||
|
|||||||
Reference in New Issue
Block a user