Simplify code

This commit is contained in:
RMidhunSuresh 2022-04-22 12:10:25 +05:30
parent 826835e518
commit c6691cf1cb

View file

@ -125,12 +125,12 @@ async function handleRequest(request) {
async function handleConfigRequest(request) {
let response = await readCache(request);
const networkResponsePromise = fetchAndUpdateConfig(request);
if (response) {
fetchAndUpdateConfig(request);
return response;
} else {
return await networkResponsePromise;
}
response = await fetchAndUpdateConfig(request);
return response;
}
async function fetchAndUpdateConfig(request) {