mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +09:00
Ignore errors fetching Factorio versions
If an error occurs trying to fetch the list of Factorio versions log a warning and then return an empty list instead of preventing the system from operating.
This commit is contained in:
1 parent
25d98d2ab3
commit
2f70db4b7e
1 file changed
+8
-1
@@ -112,7 +112,14 @@ export default class Controller {
|
|||||||
// Cache for mod portal requests
|
// Cache for mod portal requests
|
||||||
modPortalCache = new Map<string, { timestamp: number, data: any[] }>();
|
modPortalCache = new Map<string, { timestamp: number, data: any[] }>();
|
||||||
// Cache for factorio versions
|
// Cache for factorio versions
|
||||||
factorioVersions = new lib.ValueCache(lib.fetchFactorioVersions);
|
factorioVersions = new lib.ValueCache(async () => {
|
||||||
|
try {
|
||||||
|
return await lib.fetchFactorioVersions();
|
||||||
|
} catch (err: any) {
|
||||||
|
logger.warn(`Failed to retrieve Factorio versions ${err.message}`);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
static async bootstrap(config: lib.ControllerConfig) {
|
static async bootstrap(config: lib.ControllerConfig) {
|
||||||
let databaseDirectory = config.get("controller.database_directory");
|
let databaseDirectory = config.get("controller.database_directory");
|
||||||
|
|||||||
Reference in new issue
Block a user