Skip to content

Commit e7a49a8

Browse files
committed
[CORE] Use an interval not a timeout in flush
1 parent 5d0006e commit e7a49a8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/apollo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphmetrics/apollo",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"repository": "[email protected]:graphmetrics/graphmetrics-js.git",
@@ -18,7 +18,7 @@
1818
"dist"
1919
],
2020
"dependencies": {
21-
"@graphmetrics/core": "workspace:0.2.0",
21+
"@graphmetrics/core": "workspace:0.2.1",
2222
"apollo-server-plugin-base": "0.10.4"
2323
},
2424
"peerDependencies": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphmetrics/core",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"repository": "[email protected]:graphmetrics/graphmetrics-js.git",

packages/core/src/aggregator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class Aggregator {
2929

3030
this.fieldQueue = new Denque<FieldMessage>();
3131
this.operationQueue = new Denque<OperationMessage>();
32-
this.flushTimeout = setTimeout(this.flush.bind(this), FLUSH_INTERVAL);
32+
this.flushTimeout = setInterval(this.flush.bind(this), FLUSH_INTERVAL);
3333
this.sender = new Sender(config);
3434

3535
this.logger = config.logger ?? defaultLogger(config.advanced?.debug);
@@ -116,7 +116,7 @@ export class Aggregator {
116116

117117
public async stop(): Promise<void> {
118118
this.logger.debug('Stopping aggregator');
119-
clearTimeout(this.flushTimeout);
119+
clearInterval(this.flushTimeout);
120120
while (this.fieldQueue.length > 0) this.processField();
121121
this.flush();
122122
await this.sender.stop();

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)