Scaffold hatchet worker service

This commit is contained in:
Ruslan Bakiev
2026-03-30 20:54:53 +07:00
parent 3cabb069f4
commit 67a4a8c8e8
8 changed files with 260 additions and 1 deletions

17
src/worker.js Normal file
View File

@@ -0,0 +1,17 @@
import 'dotenv/config';
const requiredEnv = [
'HATCHET_CLIENT_HOST_PORT',
];
const missing = requiredEnv.filter((name) => !process.env[name]);
if (missing.length > 0) {
throw new Error(`Missing required env vars: ${missing.join(', ')}`);
}
console.log('fregat-hatchet-worker started');
console.log(`Hatchet endpoint: ${process.env.HATCHET_CLIENT_HOST_PORT}`);
setInterval(() => {
console.log('worker heartbeat');
}, 60_000);