Run the complete PROMPT stack and CI verification in Docker
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 14m10s
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 14m10s
This commit is contained in:
+7
-2
@@ -1,4 +1,4 @@
|
||||
import { mkdtemp,rm } from "node:fs/promises";
|
||||
import { mkdtemp,rm,writeFile } from "node:fs/promises";
|
||||
import { createWriteStream } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
@@ -40,5 +40,10 @@ async function processOne(){
|
||||
}finally{await rm(dir,{recursive:true,force:true});}
|
||||
return true;
|
||||
}
|
||||
async function main(){while(!stopping){try{if(!await processOne())await setTimeout(2000);}catch{console.error('Worker connection error; retrying');await setTimeout(5000);}}await db().end();}
|
||||
async function main(){
|
||||
const heartbeat=()=>writeFile('/tmp/prompt-worker-health',String(Date.now())).catch(()=>console.error('Worker heartbeat failed'));
|
||||
await heartbeat();const timer=setInterval(()=>{void heartbeat();},15000);
|
||||
try{while(!stopping){try{if(!await processOne())await setTimeout(2000);}catch{console.error('Worker connection error; retrying');await setTimeout(5000);}}}
|
||||
finally{clearInterval(timer);await db().end();}
|
||||
}
|
||||
main().catch(()=>process.exit(1));
|
||||
|
||||
Reference in New Issue
Block a user