mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-18 05:47:31 -04:00
* feat(runtime): start and ship the local agent * refactor: gate local agent behind feature flag * chore: skip agent manager if flag is false * fix: hot reload agents * test: fix config tests
22 lines
676 B
TypeScript
22 lines
676 B
TypeScript
import { Scheduler } from "../../core/scheduler";
|
|
import { db } from "../../db/db";
|
|
import { logger } from "@zerobyte/core/node";
|
|
import { createVolumeBackend } from "../backends/backend";
|
|
import { stopApplicationRuntime } from "./bootstrap";
|
|
|
|
export const shutdown = async () => {
|
|
await Scheduler.stop();
|
|
await stopApplicationRuntime();
|
|
|
|
const volumes = await db.query.volumesTable.findMany({
|
|
where: { status: "mounted" },
|
|
});
|
|
|
|
for (const volume of volumes) {
|
|
const backend = createVolumeBackend(volume);
|
|
const { status, error } = await backend.unmount();
|
|
|
|
logger.info(`Volume ${volume.name} unmount status: ${status}${error ? `, error: ${error}` : ""}`);
|
|
}
|
|
};
|