mirror of
https://github.com/unraid/api.git
synced 2026-02-22 08:18:39 -06:00
fix: ensure we check file system if no API key loaded
This commit is contained in:
@@ -258,12 +258,7 @@ export class ApiManager extends EventEmitter {
|
||||
return keyObject[0];
|
||||
}
|
||||
|
||||
private async getLock() {
|
||||
this.lock ??= new Mutex();
|
||||
return this.lock;
|
||||
}
|
||||
|
||||
private async checkKey(filePath: string, force = false) {
|
||||
async checkKey(filePath: string, force = false) {
|
||||
const lock = await this.getLock();
|
||||
await lock.runExclusive(async () => {
|
||||
apiManagerLogger.debug('Checking API key for validity.');
|
||||
@@ -302,6 +297,11 @@ export class ApiManager extends EventEmitter {
|
||||
this.expire('my_servers');
|
||||
});
|
||||
}
|
||||
|
||||
private async getLock() {
|
||||
this.lock ??= new Mutex();
|
||||
return this.lock;
|
||||
}
|
||||
}
|
||||
|
||||
export const apiManager = new ApiManager();
|
||||
|
||||
Reference in New Issue
Block a user