Merge pull request #9 from turtton/master

Fix processor behavior
This commit is contained in:
vorotamoroz 2023-03-29 17:54:30 +09:00 committed by GitHub
commit 7c84a285a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,10 @@ async function runEngine() {
log(`Failed! Reason:${result.reason}`); log(`Failed! Reason:${result.reason}`);
} else { } else {
log(`OK: stdout:${result.value.stdout}`); log(`OK: stdout:${result.value.stdout}`);
log(`OK: stderr:${result.value.stderr}`); const stderr = result.value.stderr;
if (stderr !== "") {
log(`OK: stderr:${stderr}`);
}
} }
} }
} }
@ -369,6 +372,7 @@ async function eachProc(syncKey: string, config: eachConf) {
while (running[syncKey]) { while (running[syncKey]) {
await delay(100); await delay(100);
} }
let result = true;
try { try {
running[syncKey] = true; running[syncKey] = true;
if (isKnownFile(syncKey, fromDoc._id, fromDoc._rev)) { if (isKnownFile(syncKey, fromDoc._id, fromDoc._rev)) {
@ -395,11 +399,12 @@ async function eachProc(syncKey: string, config: eachConf) {
} catch (ex) { } catch (ex) {
log("Exception on transfer doc"); log("Exception on transfer doc");
log(ex); log(ex);
result = false;
} }
} finally { } finally {
running[syncKey] = false; running[syncKey] = false;
} }
return false; return result;
} }
if (config.sync_on_connect || config.server.initialScan) { if (config.sync_on_connect || config.server.initialScan) {