Skip to content

Commit

Permalink
feat: Disable client once flushed (#1904)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Feb 19, 2019
1 parent 7e081b5 commit 1a89631
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@ since we removed some methods from the public API and removed some classes from
- **breaking** [core] ref: Use `SyncPromise` internally, this reduces memory pressure by a lot.
- **breaking** [browser] ref: Removed `BrowserBackend` from default export.
- **breaking** [node] ref: Removed `BrowserBackend` from default export.
- **breaking** [core] feat: Disable client once flushed using `close` method
- ref: Move internal `ExtendedError` to a types package
- **breaking** [core] ref: Pass `Event` to `sendEvent` instead of already stringified data
- [utils] feat: Introduce `isSyntheticEvent` util
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/baseclient.ts
Expand Up @@ -333,7 +333,9 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
* @inheritDoc
*/
public async close(timeout?: number): Promise<boolean> {
return this.flush(timeout);
return this.flush(timeout).finally(() => {
this.getOptions().enabled = false;
});
}

/**
Expand Down

0 comments on commit 1a89631

Please sign in to comment.