mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-06-17 03:34:49 -04:00
fix: simplified code in wrapped promise
This commit is contained in:
parent
d62d5a0460
commit
7fde6ee9bd
3 changed files with 22 additions and 20 deletions
|
@ -5,9 +5,10 @@ import {ErrorCaused} from "../../types/ErrorCaused";
|
|||
import {QueryType} from "../../types/QueryType";
|
||||
|
||||
import {getAvailablePlugins, install, search, uninstall} from "../../../static/js/pluginfw/installer";
|
||||
import {PackageData} from "../../types/PackageInfo";
|
||||
import {PackageData, PackageInfo} from "../../types/PackageInfo";
|
||||
import semver from 'semver';
|
||||
import log4js from 'log4js';
|
||||
import {MapArrayType} from "../../types/MapType";
|
||||
|
||||
const pluginDefs = require('../../../static/js/pluginfw/plugin_defs');
|
||||
const logger = log4js.getLogger('adminPlugins');
|
||||
|
@ -21,7 +22,13 @@ exports.socketio = (hookName:string, args:ArgsExpressType, cb:Function) => {
|
|||
if (!isAdmin) return;
|
||||
|
||||
const checkPluginForUpdates = async () => {
|
||||
const results = await getAvailablePlugins(/* maxCacheAge:*/ 60 * 10);
|
||||
let results: MapArrayType<PackageInfo>
|
||||
try {
|
||||
results = await getAvailablePlugins(/* maxCacheAge:*/ 60 * 10);
|
||||
} catch (error) {
|
||||
console.error('Error checking for plugin updates:', error);
|
||||
return [];
|
||||
}
|
||||
return Object.keys(pluginDefs.plugins).filter((plugin) => {
|
||||
if (!results[plugin]) return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue