mirror of
https://github.com/unraid/api.git
synced 2026-01-10 10:40:04 -06:00
fix: ensure we wait for file to finish being written before emitting event
This commit is contained in:
@@ -52,7 +52,13 @@ export const keyFile = () => {
|
||||
|
||||
const watcher = chokidar.watch(keyDirectory, {
|
||||
persistent: true,
|
||||
ignoreInitial: true
|
||||
ignoreInitial: true,
|
||||
awaitWriteFinish: {
|
||||
// Every 1/10 of a second poll
|
||||
// If the size stays the same for 1s then emit the event
|
||||
pollInterval: 100,
|
||||
stabilityThreshold: 1000
|
||||
}
|
||||
});
|
||||
|
||||
coreLogger.debug('Loading watchers for %s', keyDirectory);
|
||||
|
||||
Reference in New Issue
Block a user