Skip to content

Commit

Permalink
fix: guard against monitor check running while monitor check is in pr…
Browse files Browse the repository at this point in the history
…ogress
  • Loading branch information
baileympearson committed Sep 13, 2022
1 parent b8b765b commit 9377f7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sdam/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {

function monitorServer(monitor: Monitor) {
return (callback: Callback) => {
if (monitor.s.state === STATE_MONITORING) {
callback();
return;
}
stateTransition(monitor, STATE_MONITORING);
function done() {
if (!isInCloseState(monitor)) {
Expand Down

0 comments on commit 9377f7b

Please sign in to comment.