Add force=true param to bypass status cache on manual refresh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dae5524dbc
commit
1d5b345ea4
1 changed files with 2 additions and 1 deletions
|
|
@ -127,11 +127,12 @@ app.get('/deploys', async () => deployLog)
|
|||
|
||||
app.get('/status', async (request) => {
|
||||
const single = request.query?.repo
|
||||
const force = request.query?.force === 'true'
|
||||
const repos = single ? [single] : Object.keys(deployMap)
|
||||
const now = Date.now()
|
||||
const results = await Promise.all(repos.map(repo => {
|
||||
const cached = statusCache[repo]
|
||||
if (cached && (now - new Date(cached.checkedAt).getTime()) < CACHE_TTL) return cached
|
||||
if (!force && cached && (now - new Date(cached.checkedAt).getTime()) < CACHE_TTL) return cached
|
||||
return refreshStatus(repo)
|
||||
}))
|
||||
return results.filter(Boolean)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue