@volter/supercode-teams 0.2.142 → 0.2.143

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/package.json +1 -1
  2. package/worker/index.mjs +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.142",
3
+ "version": "0.2.143",
4
4
  "type": "module",
5
5
  "description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
6
6
  "license": "MIT",
package/worker/index.mjs CHANGED
@@ -100,8 +100,10 @@ export class TeamsServer extends DurableObject {
100
100
  }
101
101
  this.handler = createHttpHandler(this.api);
102
102
  // Retention must also run after a restart: a full object may have failed to re-arm its alarm.
103
- if (this.api.serverId) await maintain(this.api).catch(error => console.error(`maintain startup: ${error.message}`));
104
- if (!(await ctx.storage.getAlarm())) await ctx.storage.setAlarm(Date.now() + MAINTAIN_MS).catch(error => console.error(`maintain alarm scheduling failed: ${error.message}`));
103
+ const startup = this.api.serverId ? await maintain(this.api).catch(error => { console.error(`maintain startup: ${error.message}`); return null; }) : null;
104
+ // A capacity failure can exhaust an old alarm's retries. Re-arm on every
105
+ // activation, including a retained overdue alarm; drain backlogs promptly.
106
+ await ctx.storage.setAlarm(Date.now() + (startup?.backlog ? 3_000 : MAINTAIN_MS)).catch(error => console.error(`maintain alarm scheduling failed: ${error.message}`));
105
107
  });
106
108
  }
107
109