Constants consistency
This commit is contained in:
parent
62549e6c98
commit
619537426b
|
@ -206,17 +206,17 @@ const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
|
||||||
const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
|
const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
|
||||||
|
|
||||||
const SCHEDULER_INTERVALS_MS = {
|
const SCHEDULER_INTERVALS_MS = {
|
||||||
actorFollowScores: 60000 * 60, // 1 hour
|
ACTOR_FOLLOW_SCORES: 60000 * 60, // 1 hour
|
||||||
removeOldJobs: 60000 * 60, // 1 hour
|
REMOVE_OLD_JOBS: 60000 * 60, // 1 hour
|
||||||
updateVideos: 60000, // 1 minute
|
UPDATE_VIDEOS: 60000, // 1 minute
|
||||||
youtubeDLUpdate: 60000 * 60 * 24, // 1 day
|
YOUTUBE_DL_UPDATE: 60000 * 60 * 24, // 1 day
|
||||||
checkPlugins: CONFIG.PLUGINS.INDEX.CHECK_LATEST_VERSIONS_INTERVAL,
|
CHECK_PLUGINS: CONFIG.PLUGINS.INDEX.CHECK_LATEST_VERSIONS_INTERVAL,
|
||||||
checkPeerTubeVersion: 60000 * 60 * 24, // 1 day
|
CHECK_PEERTUBE_VERSION: 60000 * 60 * 24, // 1 day
|
||||||
autoFollowIndexInstances: 60000 * 60 * 24, // 1 day
|
AUTO_FOLLOW_INDEX_INSTANCES: 60000 * 60 * 24, // 1 day
|
||||||
removeOldViews: 60000 * 60 * 24, // 1 day
|
REMOVE_OLD_VIEWS: 60000 * 60 * 24, // 1 day
|
||||||
removeOldHistory: 60000 * 60 * 24, // 1 day
|
REMOVE_OLD_HISTORY: 60000 * 60 * 24, // 1 day
|
||||||
updateInboxStats: 1000 * 60, // 1 minute
|
UPDATE_INBOX_STATS: 1000 * 60, // 1 minute
|
||||||
removeDanglingResumableUploads: 60000 * 60 * 16 // 16 hours
|
REMOVE_DANGLING_RESUMABLE_UPLOADS: 60000 * 60 * 16 // 16 hours
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -782,14 +782,14 @@ if (isTestInstance() === true) {
|
||||||
CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max = 100 * 1024 // 100KB
|
CONSTRAINTS_FIELDS.ACTORS.IMAGE.FILE_SIZE.max = 100 * 1024 // 100KB
|
||||||
CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max = 400 * 1024 // 400KB
|
CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max = 400 * 1024 // 400KB
|
||||||
|
|
||||||
SCHEDULER_INTERVALS_MS.actorFollowScores = 1000
|
SCHEDULER_INTERVALS_MS.ACTOR_FOLLOW_SCORES = 1000
|
||||||
SCHEDULER_INTERVALS_MS.removeOldJobs = 10000
|
SCHEDULER_INTERVALS_MS.REMOVE_OLD_JOBS = 10000
|
||||||
SCHEDULER_INTERVALS_MS.removeOldHistory = 5000
|
SCHEDULER_INTERVALS_MS.REMOVE_OLD_HISTORY = 5000
|
||||||
SCHEDULER_INTERVALS_MS.removeOldViews = 5000
|
SCHEDULER_INTERVALS_MS.REMOVE_OLD_VIEWS = 5000
|
||||||
SCHEDULER_INTERVALS_MS.updateVideos = 5000
|
SCHEDULER_INTERVALS_MS.UPDATE_VIDEOS = 5000
|
||||||
SCHEDULER_INTERVALS_MS.autoFollowIndexInstances = 5000
|
SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES = 5000
|
||||||
SCHEDULER_INTERVALS_MS.updateInboxStats = 5000
|
SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS = 5000
|
||||||
SCHEDULER_INTERVALS_MS.checkPeerTubeVersion = 2000
|
SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION = 2000
|
||||||
REPEAT_JOBS['videos-views'] = { every: 5000 }
|
REPEAT_JOBS['videos-views'] = { every: 5000 }
|
||||||
REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 }
|
REPEAT_JOBS['activitypub-cleaner'] = { every: 5000 }
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class InboxManager {
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
StatsManager.Instance.updateInboxWaiting(this.getActivityPubMessagesWaiting())
|
StatsManager.Instance.updateInboxWaiting(this.getActivityPubMessagesWaiting())
|
||||||
}, SCHEDULER_INTERVALS_MS.updateInboxStats)
|
}, SCHEDULER_INTERVALS_MS.UPDATE_INBOX_STATS)
|
||||||
}
|
}
|
||||||
|
|
||||||
addInboxMessage (options: QueueParam) {
|
addInboxMessage (options: QueueParam) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ export class ActorFollowScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.actorFollowScores
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.ACTOR_FOLLOW_SCORES
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class AutoFollowIndexInstances extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.autoFollowIndexInstances
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.AUTO_FOLLOW_INDEX_INSTANCES
|
||||||
|
|
||||||
private lastCheck: Date
|
private lastCheck: Date
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class PeerTubeVersionCheckScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.checkPeerTubeVersion
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.CHECK_PEERTUBE_VERSION
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class PluginsCheckScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.checkPlugins
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.CHECK_PLUGINS
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class RemoveDanglingResumableUploadsScheduler extends AbstractScheduler {
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
private lastExecutionTimeMs: number
|
private lastExecutionTimeMs: number
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.removeDanglingResumableUploads
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.REMOVE_DANGLING_RESUMABLE_UPLOADS
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class RemoveOldHistoryScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.removeOldHistory
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.REMOVE_OLD_HISTORY
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class RemoveOldJobsScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.removeOldJobs
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.REMOVE_OLD_JOBS
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class RemoveOldViewsScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.removeOldViews
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.REMOVE_OLD_VIEWS
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.updateVideos
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.UPDATE_VIDEOS
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -6,7 +6,7 @@ export class YoutubeDlUpdateScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
private static instance: AbstractScheduler
|
private static instance: AbstractScheduler
|
||||||
|
|
||||||
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.youtubeDLUpdate
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.YOUTUBE_DL_UPDATE
|
||||||
|
|
||||||
private constructor () {
|
private constructor () {
|
||||||
super()
|
super()
|
||||||
|
|
Loading…
Reference in New Issue