mirror of
https://github.com/unraid/api.git
synced 2026-01-06 16:49:49 -06:00
fix(api-manager): skip "same key" check on first load
This commit is contained in:
@@ -65,14 +65,14 @@ export class ApiManager extends EventEmitter {
|
||||
};
|
||||
}
|
||||
|
||||
private async checkKey(filePath) {
|
||||
private async checkKey(filePath: string, force = false) {
|
||||
const lock = await this.getLock();
|
||||
try {
|
||||
const file = loadState<{ remote: { apikey: string } }>(filePath);
|
||||
const apiKey = dotProp.get(file, 'remote.apikey') as string;
|
||||
|
||||
// Same key as current
|
||||
if (apiKey === this.getKey('my_servers')?.key) {
|
||||
if (!force && (apiKey === this.getKey('my_servers')?.key)) {
|
||||
coreLogger.debug(`%s was updated but the API key didn't change`, filePath);
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ export class ApiManager extends EventEmitter {
|
||||
}
|
||||
|
||||
// Load inital keys in
|
||||
this.checkKey(configPath);
|
||||
this.checkKey(configPath, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user