mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +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
|
||||
modPortalCache = new Map<string, { timestamp: number, data: any[] }>();
|
||||
// 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) {
|
||||
let databaseDirectory = config.get("controller.database_directory");
|
||||
|
||||
Reference in new issue
Block a user