@replayio/app-building 1.8.1 → 1.8.2

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/dist/fly.js +10 -2
  2. package/package.json +1 -1
package/dist/fly.js CHANGED
@@ -127,14 +127,22 @@ export async function createMachine(app, token, image, env, name) {
127
127
  */
128
128
  export async function waitForMachine(app, token, machineId, timeoutMs = 180000) {
129
129
  const start = Date.now();
130
+ let lastLogTime = 0;
130
131
  while (Date.now() - start < timeoutMs) {
131
132
  try {
132
133
  await flyFetch(`/apps/${app}/machines/${machineId}/wait?state=started&timeout=60`, token);
133
134
  return;
134
135
  }
135
136
  catch (e) {
136
- const elapsed = Math.round((Date.now() - start) / 1000);
137
- console.log(`Still waiting for machine to start (${elapsed}s elapsed): ${e instanceof Error ? e.message : e}`);
137
+ const now = Date.now();
138
+ const elapsed = Math.round((now - start) / 1000);
139
+ // Only log at most once every 10 seconds
140
+ if (now - lastLogTime >= 10000) {
141
+ console.log(`Still waiting for machine to start (${elapsed}s elapsed): ${e instanceof Error ? e.message : e}`);
142
+ lastLogTime = now;
143
+ }
144
+ // Wait before retrying
145
+ await new Promise((r) => setTimeout(r, 5000));
138
146
  }
139
147
  }
140
148
  throw new Error(`Machine ${machineId} did not reach started state within ${timeoutMs / 1000}s`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replayio/app-building",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Library for managing agentic app-building containers",
5
5
  "type": "module",
6
6
  "exports": {