Skip to content

Commit

Permalink
health check fix and undo babel change, ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
mimecuvalo committed Mar 4, 2023
1 parent c207f6d commit 2620a3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
8 changes: 6 additions & 2 deletions app/clientHealthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function runCheck() {
'/api/client-health-check?' +
new URLSearchParams({
buildId: process.env.BUILD_ID || '',
commitSHA: process.env.NEXT_PUBLIC_VERCEL_GITHUB_COMMIT_SHA || '',
commitSHA: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA || '',
});
const response = await fetch(url);
const data = await response.text();
Expand All @@ -21,6 +21,10 @@ async function runCheck() {
// tell the App to do a hard navigation at the next opportunity.
}

let checkIntervalId: NodeJS.Timeout;
export default function clientHealthCheck() {
setInterval(runCheck, 5 * 60 * 1000 /* every 5 min */);
if (checkIntervalId) {
clearInterval(checkIntervalId);
}
checkIntervalId = setInterval(runCheck, 5 * 60 * 1000 /* every 5 min */);
}
13 changes: 0 additions & 13 deletions for-i18n-later-babel.config.json

This file was deleted.

4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ const nextConfig = {
config.plugins.push(
new webpack.DefinePlugin({
'process.env.BUILD_ID': JSON.stringify(buildId),
'process.env.NEXT_PUBLIC_VERCEL_GITHUB_COMMIT_SHA': process.env.VERCEL_GITHUB_COMMIT_SHA,
'process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA': JSON.stringify(
process.env.VERCEL_GIT_COMMIT_SHA || '-missing-'
),
})
);

Expand Down

1 comment on commit 2620a3e

@vercel
Copy link

@vercel vercel bot commented on 2620a3e Mar 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.