Skip to content

Commit 7f05c10

Browse files
authoredJan 24, 2024
fix: Race condition in the workerManager (#3507)
1 parent 253d76f commit 7f05c10

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎.changeset/nice-cars-rush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'monaco-graphql': minor
3+
---
4+
5+
Fix race condition in the worker Manager

‎packages/monaco-graphql/src/workerManager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class WorkerManager {
1818
private _lastUsedTime = 0;
1919
private _configChangeListener: IDisposable;
2020
private _worker: editor.MonacoWebWorker<GraphQLWorker> | null = null;
21-
private _client: GraphQLWorker | null = null;
21+
private _client: Promise<GraphQLWorker> | null = null;
2222

2323
constructor(defaults: MonacoGraphQLAPI) {
2424
this._defaults = defaults;
@@ -83,7 +83,7 @@ export class WorkerManager {
8383
},
8484
} as ICreateData,
8585
});
86-
this._client = await this._worker.getProxy();
86+
this._client = this._worker.getProxy();
8787
} catch (error) {
8888
// eslint-disable-next-line no-console
8989
console.error('error loading worker', error);

0 commit comments

Comments
 (0)
Please sign in to comment.