@niwa-labs/timer 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/package.json +35 -4
- package/src/cockpit/index.tsx +182 -0
- package/src/index.ts +970 -0
- package/src/records.ts +149 -0
- package/test/clock.test.ts +178 -0
- package/test/declarations.test.ts +66 -0
- package/test/firing-writes.test.ts +60 -0
- package/test/fixtures/failing-writes.ts +31 -0
- package/test/fixtures/missed-dues-host.ts +73 -0
- package/test/missed-dues.test.ts +127 -0
- package/test/schedule-state.test.ts +115 -0
- package/test/sleep-writes.test.ts +147 -0
- package/test/timer-list.test.ts +114 -0
- package/test/timer-sleep.test.ts +359 -0
- package/test/trigger.test.ts +57 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// The sleep of a handler: a durable wait that wakes once, even across a restart.
|
|
2
|
+
//
|
|
3
|
+
// The clock of the host is the one of the test, so a sleep is watched and not waited for: the
|
|
4
|
+
// test moves the time of the host and sees what it does with it.
|
|
5
|
+
|
|
6
|
+
import { expect, test } from "bun:test";
|
|
7
|
+
|
|
8
|
+
import { CORE_TYPES, record, seq } from "@niwa-labs/core";
|
|
9
|
+
import type { StoredRecord } from "@niwa-labs/core";
|
|
10
|
+
import { plugin } from "@niwa-labs/plugin";
|
|
11
|
+
import type { Plugin } from "@niwa-labs/plugin";
|
|
12
|
+
import { createNiwa, eventually, tempHome, testClock } from "@niwa-labs/testing";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
import { sleep, timers } from "../src/index.ts";
|
|
16
|
+
|
|
17
|
+
type Host = ReturnType<typeof createNiwa>;
|
|
18
|
+
|
|
19
|
+
/** The record that starts the sleep of the handler. */
|
|
20
|
+
const Start = record("test.sleep.start", z.object({}));
|
|
21
|
+
|
|
22
|
+
/** The record the handler writes when it wakes. */
|
|
23
|
+
const Woke = record("test.sleep.woke", z.object({ at: z.number() }));
|
|
24
|
+
|
|
25
|
+
/** How long the handler sleeps. */
|
|
26
|
+
const SLEEP_MS = 200;
|
|
27
|
+
|
|
28
|
+
/** The moment the clock of the host starts at. */
|
|
29
|
+
const START = 1_700_000_000_000;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The handler that sleeps and then writes a record.
|
|
33
|
+
*
|
|
34
|
+
* The sleep is a step of the handler, so the handler waits for it, and the moment it wakes is
|
|
35
|
+
* read through the clock of the host: the record says when the sleep was over.
|
|
36
|
+
*/
|
|
37
|
+
function sleeper(version?: string): Plugin {
|
|
38
|
+
return plugin(
|
|
39
|
+
"sleeper",
|
|
40
|
+
(api) => {
|
|
41
|
+
api.declare(Start, Woke);
|
|
42
|
+
api.on(Start, async (_data, step) => {
|
|
43
|
+
await sleep(step, SLEEP_MS);
|
|
44
|
+
const at = await step.now();
|
|
45
|
+
await step.emit(Woke, { at });
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
version === undefined ? undefined : { version },
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The explicit version of the sleeper that the restart tests share, so they are one plugin. */
|
|
53
|
+
const SLEEPER_VERSION = "sleeper-1";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The handler that sleeps for no time at all.
|
|
57
|
+
*
|
|
58
|
+
* A sleep of no time is over at once, but it is still a sleep: it is asked for, it is waited for,
|
|
59
|
+
* and it ends with a wake.
|
|
60
|
+
*/
|
|
61
|
+
function immediate(): Plugin {
|
|
62
|
+
return plugin("sleeper", (api) => {
|
|
63
|
+
api.declare(Start, Woke);
|
|
64
|
+
api.on(Start, async (_data, step) => {
|
|
65
|
+
await sleep(step, 0);
|
|
66
|
+
const at = await step.now();
|
|
67
|
+
await step.emit(Woke, { at });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The records of the journal of a host, from the beginning. */
|
|
73
|
+
const recordsOf = async (niwa: Host): Promise<StoredRecord[]> => niwa.records.read();
|
|
74
|
+
/** The records of one type. */
|
|
75
|
+
const ofType = (records: readonly StoredRecord[], type: string): StoredRecord[] =>
|
|
76
|
+
records.filter((row) => row.type === type);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The state of the invocation of the sleeper.
|
|
80
|
+
*
|
|
81
|
+
* The invocation is the one of the handler of "test.sleep.start": its id names the handler.
|
|
82
|
+
*/
|
|
83
|
+
const sleeperState = (records: readonly StoredRecord[]): string | undefined => {
|
|
84
|
+
let state: string | undefined;
|
|
85
|
+
for (const row of records) {
|
|
86
|
+
if (row.type !== CORE_TYPES.invocationState) continue;
|
|
87
|
+
const data = row.data as { invocation?: unknown; state?: unknown };
|
|
88
|
+
if (typeof data.invocation !== "string") continue;
|
|
89
|
+
if (!data.invocation.startsWith("inv:sleeper/")) continue;
|
|
90
|
+
if (typeof data.state === "string") state = data.state;
|
|
91
|
+
}
|
|
92
|
+
return state;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The sleep is armed: the timers plugin has seen the request and armed the wake for it.
|
|
97
|
+
*
|
|
98
|
+
* The handler of the timers plugin runs as an invocation of its own, so the state of that
|
|
99
|
+
* invocation says whether it has run.
|
|
100
|
+
*/
|
|
101
|
+
const armed = (records: readonly StoredRecord[]): boolean => {
|
|
102
|
+
for (const row of records) {
|
|
103
|
+
if (row.type !== CORE_TYPES.invocationState) continue;
|
|
104
|
+
const data = row.data as { invocation?: unknown; state?: unknown };
|
|
105
|
+
if (typeof data.invocation !== "string") continue;
|
|
106
|
+
if (!data.invocation.startsWith("inv:timers/timer-sleep:")) continue;
|
|
107
|
+
if (data.state === "done") return true;
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
test("a handler that sleeps wakes when the time has come", async () => {
|
|
113
|
+
const home = await tempHome();
|
|
114
|
+
const clock = testClock(START);
|
|
115
|
+
const niwa = createNiwa({ home: home.path, clock });
|
|
116
|
+
try {
|
|
117
|
+
niwa.use(timers([]));
|
|
118
|
+
niwa.use(sleeper());
|
|
119
|
+
await niwa.serve();
|
|
120
|
+
|
|
121
|
+
await niwa.emit(Start, {});
|
|
122
|
+
// The sleep is asked for and armed: the handler waits for the wake.
|
|
123
|
+
await eventually(async () => armed(await recordsOf(niwa)), 10_000, "the sleep was not armed");
|
|
124
|
+
expect(sleeperState(await recordsOf(niwa))).toBe("waiting");
|
|
125
|
+
expect(ofType(await recordsOf(niwa), Woke.name)).toHaveLength(0);
|
|
126
|
+
|
|
127
|
+
// The time has not come yet: the handler is still asleep.
|
|
128
|
+
await clock.advance(SLEEP_MS - 1);
|
|
129
|
+
expect(ofType(await recordsOf(niwa), Woke.name)).toHaveLength(0);
|
|
130
|
+
|
|
131
|
+
await clock.advance(1);
|
|
132
|
+
await eventually(
|
|
133
|
+
async () => ofType(await recordsOf(niwa), Woke.name).length === 1,
|
|
134
|
+
10_000,
|
|
135
|
+
"the handler did not wake",
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// The handler woke at the moment it asked for, and it woke once.
|
|
139
|
+
const woke = ofType(await recordsOf(niwa), Woke.name)[0];
|
|
140
|
+
expect((woke?.data as { at: number }).at).toBeGreaterThanOrEqual(START + SLEEP_MS);
|
|
141
|
+
expect(ofType(await recordsOf(niwa), "timer.slept")).toHaveLength(1);
|
|
142
|
+
expect(sleeperState(await recordsOf(niwa))).toBe("done");
|
|
143
|
+
expect(clock.failures()).toEqual([]);
|
|
144
|
+
} finally {
|
|
145
|
+
await niwa.close();
|
|
146
|
+
await home.cleanup();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("a host that restarts in the middle of a sleep still wakes the handler once", async () => {
|
|
151
|
+
const home = await tempHome();
|
|
152
|
+
const first = createNiwa({ home: home.path, clock: testClock(START) });
|
|
153
|
+
try {
|
|
154
|
+
first.use(timers([]));
|
|
155
|
+
first.use(sleeper());
|
|
156
|
+
await first.serve();
|
|
157
|
+
|
|
158
|
+
await first.emit(Start, {});
|
|
159
|
+
await eventually(async () => armed(await recordsOf(first)), 10_000, "the sleep was not armed");
|
|
160
|
+
expect(sleeperState(await recordsOf(first))).toBe("waiting");
|
|
161
|
+
await first.close();
|
|
162
|
+
|
|
163
|
+
// The same home, a new host: it reads the journal and finds the handler waiting.
|
|
164
|
+
const clock = testClock(START);
|
|
165
|
+
const second = createNiwa({ home: home.path, clock });
|
|
166
|
+
second.use(timers([]));
|
|
167
|
+
second.use(sleeper());
|
|
168
|
+
await second.serve();
|
|
169
|
+
|
|
170
|
+
await eventually(
|
|
171
|
+
async () => sleeperState(await recordsOf(second)) === "waiting",
|
|
172
|
+
10_000,
|
|
173
|
+
"the handler did not keep waiting",
|
|
174
|
+
);
|
|
175
|
+
expect(ofType(await recordsOf(second), Woke.name)).toHaveLength(0);
|
|
176
|
+
|
|
177
|
+
await clock.advance(SLEEP_MS);
|
|
178
|
+
await eventually(
|
|
179
|
+
async () => ofType(await recordsOf(second), Woke.name).length === 1,
|
|
180
|
+
10_000,
|
|
181
|
+
"the handler did not wake",
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// The sleep woke the handler once: one wake, one record, one request for the sleep.
|
|
185
|
+
expect(ofType(await recordsOf(second), "timer.slept")).toHaveLength(1);
|
|
186
|
+
expect(ofType(await recordsOf(second), "timer.sleep.requested")).toHaveLength(1);
|
|
187
|
+
expect(ofType(await recordsOf(second), Woke.name)).toHaveLength(1);
|
|
188
|
+
expect(sleeperState(await recordsOf(second))).toBe("done");
|
|
189
|
+
expect(clock.failures()).toEqual([]);
|
|
190
|
+
} finally {
|
|
191
|
+
await home.cleanup();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test("a sleep whose moment passed while the host was down wakes at once", async () => {
|
|
196
|
+
const home = await tempHome();
|
|
197
|
+
const first = createNiwa({ home: home.path, clock: testClock(START) });
|
|
198
|
+
try {
|
|
199
|
+
first.use(timers([]));
|
|
200
|
+
first.use(sleeper());
|
|
201
|
+
await first.serve();
|
|
202
|
+
|
|
203
|
+
await first.emit(Start, {});
|
|
204
|
+
await eventually(async () => armed(await recordsOf(first)), 10_000, "the sleep was not armed");
|
|
205
|
+
await first.close();
|
|
206
|
+
|
|
207
|
+
// The new host comes up when the moment of the sleep has passed: the sleep is over, and the
|
|
208
|
+
// handler that waits for it goes on at once.
|
|
209
|
+
const clock = testClock(START + SLEEP_MS + 1_000);
|
|
210
|
+
const second = createNiwa({ home: home.path, clock });
|
|
211
|
+
second.use(timers([]));
|
|
212
|
+
second.use(sleeper());
|
|
213
|
+
await second.serve();
|
|
214
|
+
|
|
215
|
+
await eventually(
|
|
216
|
+
async () => ofType(await recordsOf(second), Woke.name).length === 1,
|
|
217
|
+
10_000,
|
|
218
|
+
"the handler did not wake",
|
|
219
|
+
);
|
|
220
|
+
expect(ofType(await recordsOf(second), "timer.slept")).toHaveLength(1);
|
|
221
|
+
expect(sleeperState(await recordsOf(second))).toBe("done");
|
|
222
|
+
} finally {
|
|
223
|
+
await home.cleanup();
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test("a sleep of no time at all is over at once, and the handler goes on", async () => {
|
|
228
|
+
const home = await tempHome();
|
|
229
|
+
const clock = testClock(START);
|
|
230
|
+
const niwa = createNiwa({ home: home.path, clock });
|
|
231
|
+
try {
|
|
232
|
+
niwa.use(timers([]));
|
|
233
|
+
niwa.use(immediate());
|
|
234
|
+
await niwa.serve();
|
|
235
|
+
|
|
236
|
+
await niwa.emit(Start, {});
|
|
237
|
+
// The sleep ends at once: there is no moment to wait for.
|
|
238
|
+
await eventually(
|
|
239
|
+
async () => ofType(await recordsOf(niwa), Woke.name).length === 1,
|
|
240
|
+
10_000,
|
|
241
|
+
"the handler did not wake",
|
|
242
|
+
);
|
|
243
|
+
expect(ofType(await recordsOf(niwa), "timer.slept")).toHaveLength(1);
|
|
244
|
+
expect(sleeperState(await recordsOf(niwa))).toBe("done");
|
|
245
|
+
expect(clock.failures()).toEqual([]);
|
|
246
|
+
} finally {
|
|
247
|
+
await niwa.close();
|
|
248
|
+
await home.cleanup();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
/** The handler that sleeps twice, one sleep after the other: the sleeping places differ. */
|
|
253
|
+
function twice(): Plugin {
|
|
254
|
+
return plugin("sleeper", (api) => {
|
|
255
|
+
api.declare(Start, Woke);
|
|
256
|
+
api.on(Start, async (_data, step) => {
|
|
257
|
+
await sleep(step, SLEEP_MS);
|
|
258
|
+
await step.emit(Woke, { at: await step.now() });
|
|
259
|
+
await sleep(step, SLEEP_MS, "second");
|
|
260
|
+
await step.emit(Woke, { at: await step.now() });
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
test("a handler that sleeps twice wakes after each sleep, once each", async () => {
|
|
266
|
+
const home = await tempHome();
|
|
267
|
+
const clock = testClock(START);
|
|
268
|
+
const niwa = createNiwa({ home: home.path, clock });
|
|
269
|
+
try {
|
|
270
|
+
niwa.use(timers([]));
|
|
271
|
+
niwa.use(twice());
|
|
272
|
+
await niwa.serve();
|
|
273
|
+
|
|
274
|
+
await niwa.emit(Start, {});
|
|
275
|
+
await eventually(async () => armed(await recordsOf(niwa)), 10_000, "the sleep was not armed");
|
|
276
|
+
|
|
277
|
+
await clock.advance(SLEEP_MS);
|
|
278
|
+
await eventually(
|
|
279
|
+
async () => ofType(await recordsOf(niwa), Woke.name).length === 1,
|
|
280
|
+
10_000,
|
|
281
|
+
"the first sleep did not wake the handler",
|
|
282
|
+
);
|
|
283
|
+
// The second sleep is a sleep of its own: the first wake is not its answer.
|
|
284
|
+
expect(sleeperState(await recordsOf(niwa))).toBe("waiting");
|
|
285
|
+
|
|
286
|
+
await clock.advance(SLEEP_MS);
|
|
287
|
+
await eventually(
|
|
288
|
+
async () => ofType(await recordsOf(niwa), Woke.name).length === 2,
|
|
289
|
+
10_000,
|
|
290
|
+
"the second sleep did not wake the handler",
|
|
291
|
+
);
|
|
292
|
+
const records = await recordsOf(niwa);
|
|
293
|
+
expect(ofType(records, "timer.sleep.requested")).toHaveLength(2);
|
|
294
|
+
expect(ofType(records, "timer.slept")).toHaveLength(2);
|
|
295
|
+
expect(sleeperState(records)).toBe("done");
|
|
296
|
+
expect(clock.failures()).toEqual([]);
|
|
297
|
+
} finally {
|
|
298
|
+
await niwa.close();
|
|
299
|
+
await home.cleanup();
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test("a host that restarts after the wake was written, before the handler went on, wakes it once", async () => {
|
|
304
|
+
const home = await tempHome();
|
|
305
|
+
const first = createNiwa({ home: home.path, clock: testClock(START) });
|
|
306
|
+
try {
|
|
307
|
+
first.use(timers([]));
|
|
308
|
+
first.use(sleeper(SLEEPER_VERSION));
|
|
309
|
+
await first.serve();
|
|
310
|
+
await first.emit(Start, {});
|
|
311
|
+
await eventually(async () => armed(await recordsOf(first)), 10_000, "the sleep was not armed");
|
|
312
|
+
await first.close();
|
|
313
|
+
|
|
314
|
+
// A host whose handler is stuck writes the wake: nobody goes on with it.
|
|
315
|
+
const clock = testClock(START);
|
|
316
|
+
const middle = createNiwa({ home: home.path, clock });
|
|
317
|
+
middle.use(timers([]));
|
|
318
|
+
middle.use(
|
|
319
|
+
plugin(
|
|
320
|
+
"sleeper",
|
|
321
|
+
(api) => {
|
|
322
|
+
api.declare(Start, Woke);
|
|
323
|
+
api.on(Start, async () => {
|
|
324
|
+
await new Promise<never>(() => {});
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
{ version: SLEEPER_VERSION },
|
|
328
|
+
),
|
|
329
|
+
);
|
|
330
|
+
await middle.serve();
|
|
331
|
+
await clock.advance(SLEEP_MS);
|
|
332
|
+
await eventually(
|
|
333
|
+
async () => ofType(await recordsOf(middle), "timer.slept").length === 1,
|
|
334
|
+
10_000,
|
|
335
|
+
"the wake was not written",
|
|
336
|
+
);
|
|
337
|
+
expect(ofType(await recordsOf(middle), Woke.name)).toHaveLength(0);
|
|
338
|
+
await middle.close();
|
|
339
|
+
|
|
340
|
+
// The host with the handler finds the wake in the journal: the handler goes on, once, and no
|
|
341
|
+
// second wake or request is written.
|
|
342
|
+
const last = createNiwa({ home: home.path, clock: testClock(START + SLEEP_MS) });
|
|
343
|
+
last.use(timers([]));
|
|
344
|
+
last.use(sleeper(SLEEPER_VERSION));
|
|
345
|
+
await last.serve();
|
|
346
|
+
await eventually(
|
|
347
|
+
async () => ofType(await recordsOf(last), Woke.name).length === 1,
|
|
348
|
+
10_000,
|
|
349
|
+
"the handler did not go on",
|
|
350
|
+
);
|
|
351
|
+
const records = await recordsOf(last);
|
|
352
|
+
expect(ofType(records, "timer.slept")).toHaveLength(1);
|
|
353
|
+
expect(ofType(records, "timer.sleep.requested")).toHaveLength(1);
|
|
354
|
+
expect(sleeperState(records)).toBe("done");
|
|
355
|
+
await last.close();
|
|
356
|
+
} finally {
|
|
357
|
+
await home.cleanup();
|
|
358
|
+
}
|
|
359
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// A handler of a timer's trigger is all it takes: the trigger carries the schedule and names the
|
|
2
|
+
// plugin that fires it, so subscribing offers the timer, and a host without the timers says so.
|
|
3
|
+
|
|
4
|
+
import { expect, test } from "bun:test";
|
|
5
|
+
|
|
6
|
+
import { actionName, seq } from "@niwa-labs/core";
|
|
7
|
+
import { MissingReader } from "@niwa-labs/core";
|
|
8
|
+
import { plugin } from "@niwa-labs/plugin";
|
|
9
|
+
import { createNiwa, eventually, tempHome, testClock } from "@niwa-labs/testing";
|
|
10
|
+
|
|
11
|
+
import { timer, timers } from "../src/index.ts";
|
|
12
|
+
import type { TimerEntity } from "../src/index.ts";
|
|
13
|
+
|
|
14
|
+
const MINUTE_MS = 60 * 1000;
|
|
15
|
+
|
|
16
|
+
test("subscribing to a scheduled trigger schedules the timer, and its handler is woken by its firings only", async () => {
|
|
17
|
+
const home = await tempHome();
|
|
18
|
+
const clock = testClock(new Date(2024, 0, 1, 0, 0, 0, 0).getTime());
|
|
19
|
+
const niwa = createNiwa({ home: home.path, clock });
|
|
20
|
+
const fired: string[] = [];
|
|
21
|
+
try {
|
|
22
|
+
niwa.use(
|
|
23
|
+
timers([timer.every(7 * MINUTE_MS, { id: "other" })]),
|
|
24
|
+
plugin("digest", (api) => {
|
|
25
|
+
api.on(timer.every(5 * MINUTE_MS, { id: "digest" }), (data) => void fired.push(data.timer));
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
await niwa.serve();
|
|
29
|
+
const listed = (await niwa.call(actionName("timer.list"), {})) as { timers: TimerEntity[] };
|
|
30
|
+
expect(listed.timers.map((one) => one.name).sort()).toEqual(["digest", "other"]);
|
|
31
|
+
await clock.advance(15 * MINUTE_MS);
|
|
32
|
+
await eventually(() => fired.length >= 3);
|
|
33
|
+
const firings = (await niwa.records.read()).filter((row) => row.type === "timer.fired");
|
|
34
|
+
expect(firings.some((row) => (row.data as { timer: string }).timer === "other")).toBe(true);
|
|
35
|
+
expect(new Set(fired)).toEqual(new Set(["digest"]));
|
|
36
|
+
} finally {
|
|
37
|
+
await niwa.close();
|
|
38
|
+
await home.cleanup();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("a host with a handler of a timer's trigger and no timers refuses to serve and names them", async () => {
|
|
43
|
+
const home = await tempHome();
|
|
44
|
+
const niwa = createNiwa({ home: home.path });
|
|
45
|
+
try {
|
|
46
|
+
niwa.use(plugin("digest", (api) => api.on(timer.daily("21:00"), () => undefined)));
|
|
47
|
+
const refused = await niwa.serve().then(
|
|
48
|
+
() => undefined,
|
|
49
|
+
(error: unknown) => error,
|
|
50
|
+
);
|
|
51
|
+
expect(refused).toBeInstanceOf(MissingReader);
|
|
52
|
+
expect(String(refused)).toContain("timers");
|
|
53
|
+
} finally {
|
|
54
|
+
await niwa.close();
|
|
55
|
+
await home.cleanup();
|
|
56
|
+
}
|
|
57
|
+
});
|