test
This commit is contained in:
parent
055db97273
commit
57b462223c
@ -104,6 +104,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
|||||||
}
|
}
|
||||||
console.log(`Coolify's API is listening on ${host}:${port}`);
|
console.log(`Coolify's API is listening on ${host}:${port}`);
|
||||||
await initServer();
|
await initServer();
|
||||||
|
await scheduler.start('test');
|
||||||
// await scheduler.start('cleanupPrismaEngines');
|
// await scheduler.start('cleanupPrismaEngines');
|
||||||
// await scheduler.start('checkProxies');
|
// await scheduler.start('checkProxies');
|
||||||
|
|
||||||
|
15
apps/api/src/jobs/test.ts
Normal file
15
apps/api/src/jobs/test.ts
Normal 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);
|
||||||
|
})();
|
@ -18,6 +18,7 @@ const options: any = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
jobs: [
|
jobs: [
|
||||||
|
{ name: 'test' },
|
||||||
{
|
{
|
||||||
name: 'deployApplication',
|
name: 'deployApplication',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user