aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-16 15:03:00 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commitd133f3858288b20d790e9bb57664fc6e22d9aeaf (patch)
tree5ff8d553337bd97d92b0d5004e23239e4668721a /server
parente0ce715a1ded6e84c877004dae3e354c8716fb06 (diff)
downloadPeerTube-d133f3858288b20d790e9bb57664fc6e22d9aeaf.tar.gz
PeerTube-d133f3858288b20d790e9bb57664fc6e22d9aeaf.tar.zst
PeerTube-d133f3858288b20d790e9bb57664fc6e22d9aeaf.zip
Check latest plugins version with config interval
Diffstat (limited to 'server')
-rw-r--r--server/initializers/config.ts3
-rw-r--r--server/initializers/constants.ts5
-rw-r--r--server/lib/schedulers/plugins-check-scheduler.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 2c1b30021..58241e4ea 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -137,7 +137,8 @@ const CONFIG = {
137 PLUGINS: { 137 PLUGINS: {
138 INDEX: { 138 INDEX: {
139 ENABLED: config.get<boolean>('plugins.index.enabled'), 139 ENABLED: config.get<boolean>('plugins.index.enabled'),
140 URL: config.get<boolean>('plugins.index.url') 140 CHECK_LATEST_VERSIONS_INTERVAL: parseDurationToMs(config.get<string>('plugins.index.check_latest_versions_interval')),
141 URL: config.get<string>('plugins.index.url')
141 } 142 }
142 }, 143 },
143 ADMIN: { 144 ADMIN: {
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 367ae8d45..cd4d4e847 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -4,7 +4,7 @@ import { ActivityPubActorType } from '../../shared/models/activitypub'
4import { FollowState } from '../../shared/models/actors' 4import { FollowState } from '../../shared/models/actors'
5import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS } from '../../shared/models/videos' 5import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS } from '../../shared/models/videos'
6// Do not use barrels, remain constants as independent as possible 6// Do not use barrels, remain constants as independent as possible
7import { isTestInstance, sanitizeHost, sanitizeUrl, root } from '../helpers/core-utils' 7import { isTestInstance, sanitizeHost, sanitizeUrl, root, parseDurationToMs } from '../helpers/core-utils'
8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
9import { invert } from 'lodash' 9import { invert } from 'lodash'
10import { CronRepeatOptions, EveryRepeatOptions } from 'bull' 10import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
@@ -167,7 +167,7 @@ const SCHEDULER_INTERVALS_MS = {
167 removeOldJobs: 60000 * 60, // 1 hour 167 removeOldJobs: 60000 * 60, // 1 hour
168 updateVideos: 60000, // 1 minute 168 updateVideos: 60000, // 1 minute
169 youtubeDLUpdate: 60000 * 60 * 24, // 1 day 169 youtubeDLUpdate: 60000 * 60 * 24, // 1 day
170 checkPlugins: 60000 * 60 * 24, // 1 day 170 checkPlugins: CONFIG.PLUGINS.INDEX.CHECK_LATEST_VERSIONS_INTERVAL,
171 removeOldViews: 60000 * 60 * 24, // 1 day 171 removeOldViews: 60000 * 60 * 24, // 1 day
172 removeOldHistory: 60000 * 60 * 24 // 1 day 172 removeOldHistory: 60000 * 60 * 24 // 1 day
173} 173}
@@ -618,7 +618,6 @@ if (isTestInstance() === true) {
618 SCHEDULER_INTERVALS_MS.removeOldHistory = 5000 618 SCHEDULER_INTERVALS_MS.removeOldHistory = 5000
619 SCHEDULER_INTERVALS_MS.removeOldViews = 5000 619 SCHEDULER_INTERVALS_MS.removeOldViews = 5000
620 SCHEDULER_INTERVALS_MS.updateVideos = 5000 620 SCHEDULER_INTERVALS_MS.updateVideos = 5000
621 SCHEDULER_INTERVALS_MS.checkPlugins = 10000
622 REPEAT_JOBS[ 'videos-views' ] = { every: 5000 } 621 REPEAT_JOBS[ 'videos-views' ] = { every: 5000 }
623 622
624 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1 623 REDUNDANCY.VIDEOS.RANDOMIZED_FACTOR = 1
diff --git a/server/lib/schedulers/plugins-check-scheduler.ts b/server/lib/schedulers/plugins-check-scheduler.ts
index 8dfdd5177..7ff41e639 100644
--- a/server/lib/schedulers/plugins-check-scheduler.ts
+++ b/server/lib/schedulers/plugins-check-scheduler.ts
@@ -53,7 +53,7 @@ export class PluginsCheckScheduler extends AbstractScheduler {
53 plugin.latestVersion = result.latestVersion 53 plugin.latestVersion = result.latestVersion
54 await plugin.save() 54 await plugin.save()
55 55
56 logger.info('Plugin %s has a new latest version %s.', PluginModel.buildNpmName(plugin.name, plugin.type), plugin.latestVersion) 56 logger.info('Plugin %s has a new latest version %s.', result.npmName, plugin.latestVersion)
57 } 57 }
58 } 58 }
59 } catch (err) { 59 } catch (err) {