@volter/supercode-orchestrator 0.4.53 → 0.4.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/board/cli.mjs +8 -3
  2. package/package.json +1 -1
package/board/cli.mjs CHANGED
@@ -1123,11 +1123,16 @@ async function serve(root, args = {}) {
1123
1123
  } catch (error) {
1124
1124
  log(`tick failed: ${error.message}`);
1125
1125
  }
1126
- const now = installed();
1127
- if (running && now && now !== running) { log(`orchestrator ${now} is installed (this serve runs ${running}); stopping, for its keeper to start the new one`); break; }
1126
+ // a newer install is looked for after each tick and through the wait before the next
1127
+ const newer = () => { const now = installed(); return running && now && now !== running ? now : null; };
1128
+ let moved = newer();
1128
1129
  // the next tick is due an interval after this one began (a long tick is not followed by a full interval's wait)
1129
1130
  const rest = Math.max(1, interval - Math.floor((Date.now() - began) / 1000));
1130
- for (let waited = 0; waited < rest && !stopped; waited += 1) await new Promise((done) => setTimeout(done, 1000));
1131
+ for (let waited = 0; waited < rest && !stopped && !moved; waited += 1) {
1132
+ await new Promise((done) => setTimeout(done, 1000));
1133
+ if (waited % 5 === 4) moved = newer();
1134
+ }
1135
+ if (moved) { log(`orchestrator ${moved} is installed (this serve runs ${running}); stopping, for its keeper to start the new one`); break; }
1131
1136
  }
1132
1137
  } finally {
1133
1138
  lock.release();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.53",
3
+ "version": "0.4.54",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {