mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Cache mods on controller
This commit is contained in:
1 parent
600a5d5ce1
commit
d50230becc
2 files changed
+17
-2
No files matched your search
@@ -96,6 +96,13 @@ export default class Controller {
|
||||
clusterLogIndex: lib.LogIndex | null = null;
|
||||
clusterLogBuildInterval: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
// Cache for mod portal requests
|
||||
static MOD_PORTAL_CACHE_DURATION = 30 * 60 * 1000; // 30 minutes
|
||||
modPortalCache = new Map<string, { timestamp: number, data: any[] }>();
|
||||
|
||||
/** @type {?module:lib.ProcessConnector} */
|
||||
process = null;
|
||||
|
||||
static async bootstrap(config: lib.ControllerConfig) {
|
||||
let databaseDirectory = config.get("controller.database_directory");
|
||||
await fs.ensureDir(databaseDirectory);
|
||||
@@ -288,7 +295,7 @@ export default class Controller {
|
||||
let tls_cert = this.config.get("controller.tls_certificate");
|
||||
let tls_key = this.config.get("controller.tls_private_key");
|
||||
|
||||
if (httpsPort && (!tls_cert || !tls_key)) {
|
||||
if (httpsPort && (!tls_cert || !tls_key)) {
|
||||
throw new lib.StartupError(
|
||||
"tls_certificate and tls_private_key must be configure in order to use https_port"
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user