Allow read-only folder tests independently of monitoring state
CI / verify (push) Waiting to run

This commit is contained in:
Sucukdeluxe
2026-09-22 06:07:27 +02:00
parent 9d696fa89f
commit b4c3c075b7
5 changed files with 95 additions and 4 deletions
+16
View File
@@ -81,6 +81,22 @@ class FolderMonitor extends EventEmitter {
this._deactivate({ clearSeen: true, paused: false });
}
async testScan(settings) {
if (!String(settings?.folderPath || '').trim()) {
return this._result([], false, false, 'test', { error: 'Kein Ordnerpfad angegeben' });
}
const isolated = new FolderMonitor({
access: this._access,
stat: this._stat,
walkFolder: this._walkFolder,
now: this._now
});
isolated.configure({ ...settings });
const result = await isolated.scan({ emitFiles: false, trigger: 'test' });
if (!result.reachable) return { ...result, error: 'Ordner nicht erreichbar' };
return result;
}
status() {
return Object.freeze({
running: this.running,