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 29, 2022
1 parent 89e2235 commit 1249ca6
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 @@ -328,6 +328,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 1249ca6

Please sign in to comment.