Skip to content

Commit

Permalink
event handlers fire before call to testScheduleNextScan(); remove unu…
Browse files Browse the repository at this point in the history
…sed function
  • Loading branch information
csmig committed Jun 12, 2024
1 parent 5501c15 commit ae8fd2d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions lib/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ async function startScanner() {
//Remove stale files: those in historySet but not found in the current scan
removeStaleFiles(discoveredFiles)
logger.info({ component, message: `scan ended`, path: options.path })
testScheduleNextScan()
// allow queue event handlers to fire before calling testScheduleNextScan()
setTimeout(testScheduleNextScan, 0)
}
catch (e) {
logger.error({ component, error: serializeError(e) })
Expand Down Expand Up @@ -117,19 +118,6 @@ function scheduleNextScan() {
})
}

/**
* Cancels the next scan and logs.
* References options properties {path}.
*/
function cancelNextScan() {
clearTimeout(timeoutId)
logger.info({
component,
message: `scan cancelled`,
path: options.path
})
}

/**
* Returns immediately if options.historyFile is falsy.
* Initializes the history Set by reading it from a file and adding each line to the history set.
Expand Down

0 comments on commit ae8fd2d

Please sign in to comment.