This commit is contained in:
Andras Bacsai 2022-08-25 11:09:38 +02:00
parent 055db97273
commit 57b462223c
3 changed files with 17 additions and 0 deletions

View File

@ -104,6 +104,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
}
console.log(`Coolify's API is listening on ${host}:${port}`);
await initServer();
await scheduler.start('test');
// await scheduler.start('cleanupPrismaEngines');
// await scheduler.start('checkProxies');

15
apps/api/src/jobs/test.ts Normal file
View File

@ -0,0 +1,15 @@
import { parentPort } from 'node:worker_threads';;
(async () => {
if (parentPort) {
parentPort.on('message', async (message) => {
if (message === 'error') throw new Error('oops');
if (message === 'cancel') {
parentPort.postMessage('cancelled');
process.exit(0);
}
});
console.log('test job started');
process.exit(0)
} else process.exit(0);
})();

View File

@ -18,6 +18,7 @@ const options: any = {
}
},
jobs: [
{ name: 'test' },
{
name: 'deployApplication',
},