First Commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import grabTurboCiConfig from "@/utils/grab-turboci-config";
|
||||
|
||||
export default async function cronCheckServices() {
|
||||
const config = grabTurboCiConfig();
|
||||
|
||||
for (let i = 0; i < config.services.length; i++) {
|
||||
const service = config.services[i];
|
||||
|
||||
if (!service.servers) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (let srv = 0; srv < service.servers.length; srv++) {
|
||||
const server = service.servers[srv];
|
||||
|
||||
console.log("service", service.service_name);
|
||||
console.log(server.private_ip);
|
||||
|
||||
if (service.healthcheck) {
|
||||
let cmd = ``;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { AppData } from "@/data/app-data";
|
||||
import cronCheckServices from "./functions/check-services";
|
||||
|
||||
while (true) {
|
||||
console.log(`Running Cron Services ...`);
|
||||
|
||||
await cronCheckServices();
|
||||
|
||||
await Bun.sleep(AppData["CronInterval"]);
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user