mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Overlay: Introduce overlay memory limit constant
This commit is contained in:
@@ -60,6 +60,14 @@ const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 20000;
|
||||
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES =
|
||||
OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1_000_000;
|
||||
|
||||
/**
|
||||
* The minimum memory (in MB) that must be available for CodeQL to perform overlay
|
||||
* analysis. If CodeQL will be given less memory than this threshold, then the
|
||||
* action will not perform overlay analysis unless overlay analysis has been
|
||||
* explicitly enabled via environment variable.
|
||||
*/
|
||||
const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024;
|
||||
|
||||
export type RegistryConfigWithCredentials = RegistryConfigNoCredentials & {
|
||||
// Token to use when downloading packs from this registry.
|
||||
token: string;
|
||||
@@ -657,7 +665,7 @@ async function runnerSupportsOverlayAnalysis(
|
||||
}
|
||||
|
||||
const memoryFlagValue = getMemoryFlagValue(ramInput, logger);
|
||||
if (memoryFlagValue < 5 * 1024) {
|
||||
if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) {
|
||||
logger.info(
|
||||
`Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
|
||||
`due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB).`,
|
||||
|
||||
Reference in New Issue
Block a user