Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PRDP-287] chore: Add env to customize render check #94

Merged
merged 3 commits into from
Dec 15, 2023
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
8 changes: 5 additions & 3 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar"
CHECK_SIZE_INTERVAL: 100
MIN_STABLE_SIZE_ITERATIONS: 3
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: 'elastic-otel-token-header'
PDF_ENGINE_NODE_SUBKEY: 'pdf-engine-node-subkey'
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-d-connection-string"
OTEL_EXPORTER_OTLP_HEADERS: "elastic-otel-token-header"
PDF_ENGINE_NODE_SUBKEY: "pdf-engine-node-subkey"
keyvault:
name: "pagopa-d-shared-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down
2 changes: 2 additions & 0 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar"
CHECK_SIZE_INTERVAL: 100
MIN_STABLE_SIZE_ITERATIONS: 3
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: 'elastic-otel-token-header'
Expand Down
8 changes: 5 additions & 3 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
JAVA_TOOL_OPTIONS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar"
CHECK_SIZE_INTERVAL: 100
MIN_STABLE_SIZE_ITERATIONS: 3
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: 'elastic-otel-token-header'
PDF_ENGINE_NODE_SUBKEY: 'pdf-engine-node-subkey'
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-u-connection-string"
OTEL_EXPORTER_OTLP_HEADERS: "elastic-otel-token-header"
PDF_ENGINE_NODE_SUBKEY: "pdf-engine-node-subkey"
keyvault:
name: "pagopa-u-shared-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down
4 changes: 2 additions & 2 deletions node/pdf-generate/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ const generatePdf = async function (req, res, next) {
}

const waitForRender = async (page, timeout = 30000) => {
const checkInterval = 100;
const checkInterval = process.env.CHECK_SIZE_INTERVAL || 100;
const maxChecks = timeout / checkInterval;
let lastSize = 0;
let checkCounts = 1;
let countStableSizeIterations = 0;
const minStableSizeIterations = 3;
const minStableSizeIterations = process.env.MIN_STABLE_SIZE_ITERATIONS || 3;

while(checkCounts++ <= maxChecks){
let html = await page.content();
Expand Down
Loading