Skip to content

Commit

Permalink
Error when processing new files
Browse files Browse the repository at this point in the history
Fixes #236
  • Loading branch information
neilenns committed Jun 16, 2020
1 parent b45663d commit c9d8f06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ export default class Trigger {
}

try {
this._watcher = chokidar.watch(this.watchPattern).on("add", this.processImage.bind(this));
this._watcher = chokidar
.watch(this.watchPattern, { awaitWriteFinish: true })
.on("add", this.processImage.bind(this));
log.info(`Trigger ${this.name}`, `Listening for new images in ${this.watchPattern}`);
} catch (e) {
log.error(`Trigger ${this.name}`, `Unable to start watching for images: ${e}`);
Expand Down

0 comments on commit c9d8f06

Please sign in to comment.