mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-21 00:26:01 +02:00
Cast PODCAST_DOWNLOAD_TIMEOUT and MAX_FAILED_EPISODE_CHECKS env vars to numbers
This commit is contained in:
parent
84c9c6cb50
commit
8e01859075
1 changed files with 3 additions and 12 deletions
|
@ -12,6 +12,7 @@ const { version } = require('../package.json')
|
|||
|
||||
// Utils
|
||||
const fileUtils = require('./utils/fileUtils')
|
||||
const { toNumber } = require('./utils/index')
|
||||
const Logger = require('./Logger')
|
||||
|
||||
const Auth = require('./Auth')
|
||||
|
@ -84,18 +85,8 @@ class Server {
|
|||
global.DisableSsrfRequestFilter = (url) => whitelistedUrls.includes(new URL(url).hostname)
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.PODCAST_DOWNLOAD_TIMEOUT) {
|
||||
global.PodcastDownloadTimeout = process.env.PODCAST_DOWNLOAD_TIMEOUT
|
||||
} else {
|
||||
global.PodcastDownloadTimeout = 30000
|
||||
}
|
||||
|
||||
if (process.env.MAX_FAILED_EPISODE_CHECKS) {
|
||||
global.MaxFailedEpisodeChecks = process.env.MAX_FAILED_EPISODE_CHECKS
|
||||
} else {
|
||||
global.MaxFailedEpisodeChecks = 24
|
||||
}
|
||||
global.PodcastDownloadTimeout = toNumber(process.env.PODCAST_DOWNLOAD_TIMEOUT, 30000)
|
||||
global.MaxFailedEpisodeChecks = toNumber(process.env.MAX_FAILED_EPISODE_CHECKS, 24)
|
||||
|
||||
if (!fs.pathExistsSync(global.ConfigPath)) {
|
||||
fs.mkdirSync(global.ConfigPath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue