@masslessai/push-todo 3.6.7 → 3.6.8
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/lib/daemon.js +8 -1
- package/package.json +1 -1
package/lib/daemon.js
CHANGED
|
@@ -1215,12 +1215,19 @@ async function mainLoop() {
|
|
|
1215
1215
|
function cleanup() {
|
|
1216
1216
|
log('Daemon shutting down...');
|
|
1217
1217
|
|
|
1218
|
-
// Kill running tasks
|
|
1218
|
+
// Kill running tasks and mark them as failed in Supabase
|
|
1219
1219
|
for (const [displayNumber, taskInfo] of runningTasks) {
|
|
1220
1220
|
log(`Killing task #${displayNumber}`);
|
|
1221
1221
|
try {
|
|
1222
1222
|
taskInfo.process.kill('SIGTERM');
|
|
1223
1223
|
} catch {}
|
|
1224
|
+
// Mark as failed so the task doesn't stay as 'running' forever
|
|
1225
|
+
const duration = Math.floor((Date.now() - taskInfo.startTime) / 1000);
|
|
1226
|
+
updateTaskStatus(displayNumber, 'failed', {
|
|
1227
|
+
error: `Daemon shutdown after ${duration}s`
|
|
1228
|
+
});
|
|
1229
|
+
const projectPath = taskProjectPaths.get(displayNumber);
|
|
1230
|
+
cleanupWorktree(displayNumber, projectPath);
|
|
1224
1231
|
}
|
|
1225
1232
|
|
|
1226
1233
|
// Clean up files
|