[web] wait for prefetching of projects listing (#25650)

GitOrigin-RevId: 59fb0c74b8cf6a496e256960f7f2e83ace2c5ee0
This commit is contained in:
Jakob Ackermann
2025-05-16 09:00:48 +01:00
committed by Copybot
parent efa39ee664
commit bc78432e62

View File

@@ -314,18 +314,9 @@ async function projectListPage(req, res, next) {
delete req.session.saml
}
function fakeDelay() {
return new Promise(resolve => {
setTimeout(() => resolve(undefined), 0)
})
}
const prefetchedProjectsBlob = await Promise.race([
projectsBlobPending,
fakeDelay(),
])
const prefetchedProjectsBlob = await projectsBlobPending
Metrics.inc('project-list-prefetch-projects', 1, {
status: prefetchedProjectsBlob ? 'success' : 'too-slow',
status: prefetchedProjectsBlob ? 'success' : 'error',
})
// in v2 add notifications for matching university IPs