Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion statusline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,14 @@ if ($versionNeedsRefresh) {
-Headers @{ "Accept" = "application/vnd.github+json" } -Method Get -TimeoutSec 5 -ErrorAction Stop
$versionData = $vcResponse | ConvertTo-Json -Depth 10
$versionData | Set-Content $versionCacheFile -Force
} catch {}
} catch {
# Fetch failed — if the cache has no usable content, drop the empty
# stampede lock so the next render retries instead of the fresh mtime
# suppressing update checks for the full 24h TTL.
if ((Test-Path $versionCacheFile) -and (Get-Item $versionCacheFile).Length -eq 0) {
Remove-Item $versionCacheFile -Force -ErrorAction SilentlyContinue
}
}
}

$updateLine = ""
Expand Down
5 changes: 5 additions & 0 deletions statusline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ if $version_needs_refresh; then
if [ -n "$vc_response" ] && echo "$vc_response" | jq -e '.tag_name' >/dev/null 2>&1; then
version_data="$vc_response"
echo "$vc_response" > "$version_cache_file"
elif [ ! -s "$version_cache_file" ]; then
# Fetch failed and the cache has no usable content — drop the empty
# stampede lock so the next render retries instead of the fresh mtime
# suppressing update checks for the full 24h TTL.
rm -f "$version_cache_file" 2>/dev/null
fi
fi

Expand Down