mirror of
https://github.com/actions/deploy-pages.git
synced 2026-09-27 05:06:54 +00:00
Validate deployment polling intervals
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
19
dist/index.js
generated
vendored
19
dist/index.js
generated
vendored
@@ -149920,6 +149920,7 @@ const finalErrorStatus = {
|
||||
}
|
||||
|
||||
const MAX_TIMEOUT = 600000
|
||||
const DEFAULT_REPORTING_INTERVAL = 5000
|
||||
const MAX_REPORTING_INTERVAL = 30000
|
||||
const REPORTING_BACKOFF_MULTIPLIER = 1.5
|
||||
const REPORTING_JITTER_FACTOR = 0.2
|
||||
@@ -150042,9 +150043,19 @@ class Deployment {
|
||||
}
|
||||
|
||||
const deploymentId = this.deploymentInfo.id || this.buildVersion
|
||||
let reportingInterval = Number(core.getInput('reporting_interval'))
|
||||
const reportingIntervalInput = Number(core.getInput('reporting_interval'))
|
||||
const initialReportingInterval =
|
||||
Number.isFinite(reportingIntervalInput) && reportingIntervalInput > 0
|
||||
? reportingIntervalInput
|
||||
: DEFAULT_REPORTING_INTERVAL
|
||||
const maxReportingInterval = Math.max(MAX_REPORTING_INTERVAL, initialReportingInterval)
|
||||
const maxErrorCount = Number(core.getInput('error_count'))
|
||||
|
||||
if (initialReportingInterval !== reportingIntervalInput) {
|
||||
core.warning(`Invalid reporting_interval value; using the default of ${DEFAULT_REPORTING_INTERVAL} milliseconds.`)
|
||||
}
|
||||
|
||||
let reportingInterval = initialReportingInterval
|
||||
let errorCount = 0
|
||||
|
||||
// Time in milliseconds between two deployment status report when status errored, default 0.
|
||||
@@ -150083,10 +150094,7 @@ class Deployment {
|
||||
|
||||
// reset the error reporting interval once get the proper status back.
|
||||
errorReportingInterval = 0
|
||||
reportingInterval = Math.min(
|
||||
Math.round(reportingInterval * REPORTING_BACKOFF_MULTIPLIER),
|
||||
MAX_REPORTING_INTERVAL
|
||||
)
|
||||
reportingInterval = Math.min(Math.round(reportingInterval * REPORTING_BACKOFF_MULTIPLIER), maxReportingInterval)
|
||||
} catch (error) {
|
||||
core.error(error.stack)
|
||||
|
||||
@@ -150153,6 +150161,7 @@ class Deployment {
|
||||
module.exports = {
|
||||
Deployment,
|
||||
MAX_TIMEOUT,
|
||||
DEFAULT_REPORTING_INTERVAL,
|
||||
MAX_REPORTING_INTERVAL,
|
||||
ONE_GIGABYTE,
|
||||
SIZE_LIMIT_DESCRIPTION
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user