mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-29 02:46:25 +02:00
feat: add seedFolderMtimes API for seeding file modification times during folder synchronization
This commit is contained in:
parent
e8c2377824
commit
d009d06432
6 changed files with 48 additions and 0 deletions
|
|
@ -212,5 +212,15 @@ export async function uploadFolderScan(params: FolderSyncParams): Promise<number
|
|||
|
||||
params.onProgress?.({ phase: "done", uploaded: entriesToUpload.length, total: entriesToUpload.length });
|
||||
|
||||
// Seed the Electron mtime store so the reconciliation scan in
|
||||
// startWatcher won't re-emit events for files we just indexed.
|
||||
if (api.seedFolderMtimes) {
|
||||
const mtimes: Record<string, number> = {};
|
||||
for (const f of allFiles) {
|
||||
mtimes[f.relativePath] = f.mtimeMs;
|
||||
}
|
||||
await api.seedFolderMtimes(folderPath, mtimes);
|
||||
}
|
||||
|
||||
return rootFolderId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue