Scaffold hatchet worker service
This commit is contained in:
17
src/worker.js
Normal file
17
src/worker.js
Normal 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);
|
||||
Reference in New Issue
Block a user