fosrl.pangolin/server/routers/newt/dockerSocket.ts

23 lines
491 B
TypeScript
Raw Normal View History

2025-05-29 22:34:05 +05:30
import NodeCache from "node-cache";
import { sendToClient } from "../ws";
export const dockerSocketCache = new NodeCache({
stdTTL: 3600 // seconds
});
export function fetchContainers(newtId: string) {
const payload = {
type: `newt/socket/fetch`,
data: {}
};
sendToClient(newtId, payload);
}
export function dockerSocket(newtId: string) {
const payload = {
type: `newt/socket/check`,
data: {}
};
sendToClient(newtId, payload);
}