Use common getTotalCacheSize for TRAP caching

This commit is contained in:
Michael B. Gale 2024-10-29 11:52:15 +00:00
parent 0cb71294e5
commit 21e6a62b15
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
9 changed files with 9 additions and 28 deletions

View file

@ -17,6 +17,7 @@ import {
import { getGitHubVersion } from "./api-client";
import {
getDependencyCachingEnabled,
getTotalCacheSize,
shouldRestoreCache,
} from "./caching-utils";
import { CodeQL } from "./codeql";
@ -51,7 +52,6 @@ import {
import { ZstdAvailability } from "./tar";
import { ToolsDownloadStatusReport } from "./tools-download";
import { ToolsFeature } from "./tools-features";
import { getTotalCacheSize } from "./trap-caching";
import {
checkDiskUsage,
checkForTimeout,
@ -230,7 +230,7 @@ async function sendCompletedStatusReport(
packs: JSON.stringify(packs),
trap_cache_languages: Object.keys(config.trapCaches).join(","),
trap_cache_download_size_bytes: Math.round(
await getTotalCacheSize(config.trapCaches, logger),
await getTotalCacheSize(Object.values(config.trapCaches), logger),
),
trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime),
query_filters: JSON.stringify(