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

Method start

daemon/src/entity/commands/task/time.ts:11–25  ·  view source on GitHub ↗
(instance: Instance)

Source from the content-addressed store, hash-verified

9 private task: any = null;
10
11 async start(instance: Instance) {
12 this.task = setInterval(async () => {
13 if (instance.config.endTime) {
14 const endTime = instance.config.endTime;
15 if (endTime) {
16 const currentTime = Date.now();
17 if (endTime <= currentTime) {
18 // Expired, execute the end process command
19 await instance.execPreset("kill");
20 clearInterval(this.task);
21 }
22 }
23 }
24 }, 1000 * 60 * 60);
25 }
26
27 async stop(instance: Instance) {
28 clearInterval(this.task);

Callers

nothing calls this directly

Calls 1

execPresetMethod · 0.45

Tested by

no test coverage detected