🐛 Adguard logic and several small bugs

This commit is contained in:
Angel
2023-09-01 15:59:01 -04:00
committed by GitHub
parent ba7e31b972
commit 1bb1a8f628
5 changed files with 198 additions and 49 deletions

View File

@@ -62,6 +62,18 @@ export class PiHoleClient {
);
}
return json as PiHoleApiStatusChangeResponse;
for(let loops = 0; loops < 10; loops++){
const summary = await this.getSummary()
if (summary.status === action + 'd'){
return json as PiHoleApiStatusChangeResponse;
}
await new Promise ((resolve) => { setTimeout(resolve, 50)});
}
return Promise.reject(
new Error(
`Although PiHole received the command, it failed to update it's status: ${json}`
)
)
}
}