Skip to content

Commit

Permalink
chore: change to setTimeout (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Mar 7, 2024
1 parent 1cb9141 commit 4b8bb1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-moles-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@0no-co/graphqlsp': patch
---

Change `setInterval` to `setTimeout`
7 changes: 4 additions & 3 deletions packages/graphqlsp/src/graphql/getSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ export const loadSchema = (
logger(`Got invalid response ${JSON.stringify(result)}`);
}
});

setTimeout(() => {
pollSchema();
}, 1000 * 60);
};

pollSchema();
setInterval(() => {
pollSchema();
}, 1000 * 60);
} else if (typeof schema === 'string') {
const isJson = path.extname(schema) === '.json';
const resolvedPath = path.resolve(path.dirname(root), schema);
Expand Down

0 comments on commit 4b8bb1b

Please sign in to comment.