Skip to content

Commit

Permalink
fix worker creation problem when changing config (#2253)
Browse files Browse the repository at this point in the history
the language worker will no longer create a new instance of itself every time the config changes (schema, etc),
  • Loading branch information
acao committed Mar 27, 2022
1 parent 6060604 commit 6317789
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brown-eggs-tulip.md
@@ -0,0 +1,5 @@
---
"monaco-graphql": patch
---

fix worker + n problem when changing config (schema, etc) in `monaco-graphql`
2 changes: 1 addition & 1 deletion packages/monaco-graphql/src/workerManager.ts
Expand Up @@ -64,7 +64,7 @@ export class WorkerManager {

private async _getClient(): Promise<GraphQLWorker> {
this._lastUsedTime = Date.now();
if (!this._client) {
if (!this._client && !this._worker) {
try {
this._worker = monacoEditor.createWebWorker<GraphQLWorker>({
// module that exports the create() method and returns a `GraphQLWorker` instance
Expand Down

0 comments on commit 6317789

Please sign in to comment.