bugfix/sync-not-working-properly (#8168)

pull/8200/head
Efraín Rochín 2023-04-11 07:51:27 -07:00 committed by GitHub
parent e3a1f20cc8
commit a5bebe2b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,7 @@ export const getStaticProps: GetStaticProps<
revalidate: 1,
};
} catch (error) {
let message = "Unknown error while fetching calendarƒ";
let message = "Unknown error while fetching calendar";
if (error instanceof Error) message = error.message;
console.error(error, message);
return {

View File

@ -193,6 +193,9 @@ const getNextCache = async (username: string, month: string): Promise<EventBusyD
)
.then((r) => r.json())
.then((json) => json?.pageProps?.results);
// No need to wait for this, the purpose is to force re-validation every second as indicated
// in page getStaticProps.
fetch(`${baseUrl}/${username}/calendar-cache/${month}`).catch(console.log);
} catch (e) {
log.warn(e);
}