transloadit / uppy-server

[DEPRECATED] 'Uppy Server' was renamed to 'Companion' and lives inside the Uppy repo no
https://github.com/transloadit/uppy/tree/master/packages/%40uppy/companion
MIT License
114 stars 27 forks source link

fs call added to check file exist before deleting. #82

Closed rajascript closed 6 years ago

rajascript commented 6 years ago

Throws ENOENT without this.

Acconut commented 6 years ago

The usual recommended way is to check if fs.unlink returned an ENOENT and ignore it. This avoid the additional (synchronous) file operation and possible race conditions.

ifedapoolarewaju commented 6 years ago

yes initially we were doing an existSync check, but it was later dropped based on @Acconut 's comment