MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / InstanceDiskCheckTask

Class InstanceDiskCheckTask

daemon/src/entity/commands/task/any_stats.ts:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import { ILifeCycleTask } from "../../instance/life_cycle";
4
5export default class InstanceDiskCheckTask implements ILifeCycleTask {
6 public status: number = 0;
7 public name: string = "AnyInstanceStats";
8
9 private task: any = null;
10
11 async start(instance: Instance) {
12 this.task = setInterval(() => {
13 disk_limit_service.checkInstanceDiskSize(instance);
14 }, 1000 * 45);
15 }
16
17 async stop(instance: Instance) {
18 clearInterval(this.task);
19 instance.info = {
20 ...instance.info,
21 storageUsage: 0,
22 storageLimit: instance.config.docker?.maxSpace ?? 0
23 };
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected