()
| 23 | if (!isAdmin) return; |
| 24 | |
| 25 | const checkPluginForUpdates = async () => { |
| 26 | let results: MapArrayType<PackageInfo> |
| 27 | try { |
| 28 | results = await getAvailablePlugins(/* maxCacheAge:*/ 60 * 10); |
| 29 | } catch (error) { |
| 30 | console.error('Error checking for plugin updates:', error); |
| 31 | return []; |
| 32 | } |
| 33 | return Object.keys(pluginDefs.plugins).filter((plugin) => { |
| 34 | if (!results[plugin]) return false; |
| 35 | |
| 36 | const latestVersion = results[plugin].version; |
| 37 | const currentVersion = pluginDefs.plugins[plugin].package.version; |
| 38 | |
| 39 | return semver.gt(latestVersion, currentVersion); |
| 40 | }) |
| 41 | } |
| 42 | |
| 43 | socket.on('getStats', ()=>{ |
| 44 | console.log("Getting stats for admin plugins"); |
no test coverage detected