mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-08 21:09:37 +00:00
Fix:Include Watcher as lib with no dependencies and fix tiny-readdir bug #610
This commit is contained in:
parent
160dac109d
commit
ec6e70725c
34 changed files with 2187 additions and 281 deletions
28
server/libs/watcher/atomically/utils/fs_handlers.js
Normal file
28
server/libs/watcher/atomically/utils/fs_handlers.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
/* IMPORT */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const consts_1 = require("../consts");
|
||||
/* FS HANDLERS */
|
||||
const Handlers = {
|
||||
isChangeErrorOk: (error) => {
|
||||
const { code } = error;
|
||||
if (code === 'ENOSYS')
|
||||
return true;
|
||||
if (!consts_1.IS_USER_ROOT && (code === 'EINVAL' || code === 'EPERM'))
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
isRetriableError: (error) => {
|
||||
const { code } = error;
|
||||
if (code === 'EMFILE' || code === 'ENFILE' || code === 'EAGAIN' || code === 'EBUSY' || code === 'EACCESS' || code === 'EACCS' || code === 'EPERM')
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
onChangeError: (error) => {
|
||||
if (Handlers.isChangeErrorOk(error))
|
||||
return;
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
/* EXPORT */
|
||||
exports.default = Handlers;
|
||||
Loading…
Add table
Add a link
Reference in a new issue