150
return;
151
}
153
>
const stat = await this._fileService.resolve(this._basePath);
154
>
if (!stat.children) {
155
return;
156
}
158
>
const deletions: Promise<void>[] = [];
159
>
for (const child of stat.children) {
160
>
if (!child.isDirectory) {
161
continue;
162
}
164
>
if (!knownSessionIds.has(name)) {
165
>
this._logService.trace(`[SessionDataService] Cleaning up orphaned session data: ${name}`);
166
>
deletions.push(
167
>
this._fileService.del(child.resource, { recursive: true }).catch(err => {
168
this._logService.warn(`[SessionDataService] Failed to clean up orphaned data: ${name}`, err);
170
>
);
171
>
}
172
>
}
173
>
174
>
await Promise.all(deletions);
175
>
} catch (err) {
176
this._logService.warn('[SessionDataService] Failed to run orphan cleanup', err);
177
}