mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Add try/catch to fileutils.getFileMtimeMs
This commit is contained in:
parent
fbbceddba8
commit
e4effebc19
@ -81,7 +81,12 @@ module.exports.getFileSize = async (path) => {
|
|||||||
* @returns {Promise<number>} epoch timestamp
|
* @returns {Promise<number>} epoch timestamp
|
||||||
*/
|
*/
|
||||||
module.exports.getFileMTimeMs = async (path) => {
|
module.exports.getFileMTimeMs = async (path) => {
|
||||||
|
try {
|
||||||
return (await getFileStat(path))?.mtimeMs || 0
|
return (await getFileStat(path))?.mtimeMs || 0
|
||||||
|
} catch (err) {
|
||||||
|
Logger.error(`[fileUtils] Failed to getFileMtimeMs`, err)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user