diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-11 16:54:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:41 +0100 |
commit | 32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf (patch) | |
tree | 1db53245688a6b7839cab00f9d65e6c1c1774b00 /server/lib/schedulers/plugins-check-scheduler.ts | |
parent | 3fbc6974334ca58c068f0f9def0b0a40db2a6de1 (diff) | |
download | PeerTube-32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf.tar.gz PeerTube-32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf.tar.zst PeerTube-32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf.zip |
Add new plugin/peertube version notifs
Diffstat (limited to 'server/lib/schedulers/plugins-check-scheduler.ts')
-rw-r--r-- | server/lib/schedulers/plugins-check-scheduler.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/schedulers/plugins-check-scheduler.ts b/server/lib/schedulers/plugins-check-scheduler.ts index 014993e94..9a1ae3ec5 100644 --- a/server/lib/schedulers/plugins-check-scheduler.ts +++ b/server/lib/schedulers/plugins-check-scheduler.ts | |||
@@ -6,6 +6,7 @@ import { PluginModel } from '../../models/server/plugin' | |||
6 | import { chunk } from 'lodash' | 6 | import { chunk } from 'lodash' |
7 | import { getLatestPluginsVersion } from '../plugins/plugin-index' | 7 | import { getLatestPluginsVersion } from '../plugins/plugin-index' |
8 | import { compareSemVer } from '../../../shared/core-utils/miscs/miscs' | 8 | import { compareSemVer } from '../../../shared/core-utils/miscs/miscs' |
9 | import { Notifier } from '../notifier' | ||
9 | 10 | ||
10 | export class PluginsCheckScheduler extends AbstractScheduler { | 11 | export class PluginsCheckScheduler extends AbstractScheduler { |
11 | 12 | ||
@@ -53,6 +54,11 @@ export class PluginsCheckScheduler extends AbstractScheduler { | |||
53 | plugin.latestVersion = result.latestVersion | 54 | plugin.latestVersion = result.latestVersion |
54 | await plugin.save() | 55 | await plugin.save() |
55 | 56 | ||
57 | // Notify if there is an higher plugin version available | ||
58 | if (compareSemVer(plugin.version, result.latestVersion) < 0) { | ||
59 | Notifier.Instance.notifyOfNewPluginVersion(plugin) | ||
60 | } | ||
61 | |||
56 | logger.info('Plugin %s has a new latest version %s.', result.npmName, plugin.latestVersion) | 62 | logger.info('Plugin %s has a new latest version %s.', result.npmName, plugin.latestVersion) |
57 | } | 63 | } |
58 | } | 64 | } |