Skip to content

Commit 1d13d72

Browse files
committed
Simplify async logic by using an async anonymous function.
1 parent 4273c72 commit 1d13d72

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

packages/services/src/session/manager.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ export class SessionManager implements Session.IManager {
2929
options.serverSettings || ServerConnection.makeSettings();
3030

3131
// Initialize internal data.
32-
this._ready = Promise.all([this.requestRunning(), this.requestSpecs()])
33-
.then(_ => undefined)
34-
.catch(_ => undefined)
35-
.then(() => {
36-
if (this.isDisposed) {
37-
return;
38-
}
32+
this._ready = (async () => {
33+
await Promise.all([this.requestRunning(), this.requestSpecs()]);
34+
if (!this.isDisposed) {
3935
this._isReady = true;
40-
});
36+
}
37+
})();
4138

4239
// Start model and specs polling with exponential backoff.
4340
this._pollModels = new Poll({

0 commit comments

Comments
 (0)