Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

test

Andras Bacsai57b462223c22
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 6130ebf7f3..52b4bfd50b 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -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');
diff --git a/apps/api/src/jobs/test.ts b/apps/api/src/jobs/test.ts
new file mode 100644
index 0000000000..2d0fc44c32
--- /dev/null
+++ b/apps/api/src/jobs/test.ts
@@ -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);
+})();
diff --git a/apps/api/src/lib/scheduler.ts b/apps/api/src/lib/scheduler.ts
index 6c233d050e..efe12d5c02 100644
--- a/apps/api/src/lib/scheduler.ts
+++ b/apps/api/src/lib/scheduler.ts
@@ -18,6 +18,7 @@ const options: any = {
}
},
jobs: [
+ { name: 'test' },
{
name: 'deployApplication',
},