@trim21/personal-pi-extensions 0.0.273 → 0.0.276
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/package.json +1 -1
- package/src/talk/core.ts +3 -0
package/package.json
CHANGED
package/src/talk/core.ts
CHANGED
|
@@ -112,6 +112,7 @@ export class TalkCore {
|
|
|
112
112
|
private inboxPoll: ReturnType<typeof setInterval> | undefined;
|
|
113
113
|
private watchPoller: ReturnType<typeof setInterval> | undefined;
|
|
114
114
|
private sweeper: ReturnType<typeof setInterval> | undefined;
|
|
115
|
+
private initialDrain: ReturnType<typeof setTimeout> | undefined;
|
|
115
116
|
private lastDeliveryFailureAt = 0;
|
|
116
117
|
|
|
117
118
|
constructor(options: TalkCoreOptions) {
|
|
@@ -155,9 +156,11 @@ export class TalkCore {
|
|
|
155
156
|
void this.checkInbox();
|
|
156
157
|
}, INITIAL_DRAIN_DELAY_MS);
|
|
157
158
|
initial.unref();
|
|
159
|
+
this.initialDrain = initial;
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
async stop(): Promise<void> {
|
|
163
|
+
if (this.initialDrain) clearTimeout(this.initialDrain);
|
|
161
164
|
if (this.watchPoller) clearInterval(this.watchPoller);
|
|
162
165
|
if (this.inboxPoll) clearInterval(this.inboxPoll);
|
|
163
166
|
if (this.sweeper) clearInterval(this.sweeper);
|