genbox 1.0.139 → 1.0.140
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.
- package/dist/commands/status.js +11 -2
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -350,11 +350,20 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
350
350
|
const currentHourStart = new Date(currentHourEnd.getTime() - 60 * 60 * 1000);
|
|
351
351
|
const minutesIntoBillingHour = Math.floor((now.getTime() - currentHourStart.getTime()) / (60 * 1000));
|
|
352
352
|
const minutesUntilDestroy = Math.max(0, 58 - minutesIntoBillingHour);
|
|
353
|
-
if (
|
|
353
|
+
// Check if there was activity after the 50 min mark (this is what prevents auto-destroy)
|
|
354
|
+
const fiftyMinMark = new Date(currentHourStart.getTime() + 50 * 60 * 1000);
|
|
355
|
+
const lastActivity = billing.lastActivityAt ? new Date(billing.lastActivityAt) : null;
|
|
356
|
+
const wasActiveAfter50Min = lastActivity ? lastActivity.getTime() >= fiftyMinMark.getTime() : false;
|
|
357
|
+
// Auto-destroy is paused if we're past 50min mark AND there was activity after 50min
|
|
358
|
+
const isAutoDestroyPaused = minutesIntoBillingHour >= 50 && wasActiveAfter50Min;
|
|
359
|
+
if (isAutoDestroyPaused) {
|
|
360
|
+
console.log(chalk_1.default.green(` Auto-destroy: paused`));
|
|
361
|
+
}
|
|
362
|
+
else if (minutesInactive >= 5) {
|
|
354
363
|
console.log(chalk_1.default.yellow(` Auto-destroy in: ${minutesUntilDestroy} min (inactive)`));
|
|
355
364
|
}
|
|
356
365
|
else {
|
|
357
|
-
console.log(chalk_1.default.
|
|
366
|
+
console.log(chalk_1.default.dim(` Auto-destroy: ${minutesUntilDestroy} min`));
|
|
358
367
|
}
|
|
359
368
|
}
|
|
360
369
|
}
|