Skip to content

Commit a7b04d0

Browse files
nipunn1313Convex, Inc.
authored andcommitted
Debounce the push of static lambda to once every 30s at most. (#42297)
GitOrigin-RevId: 5bd065ac276247cb34267656d2eaf2ea9e6e10f5
1 parent 4f285a9 commit a7b04d0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

crates/common/src/knobs.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,9 +1050,15 @@ pub static FUNRUN_INITIAL_PERMIT_TIMEOUT: LazyLock<Duration> =
10501050
/// larger than (N / 15) where N is the number of instances with lambdas.
10511051
///
10521052
/// You can check go/num-instances-with-lambdas
1053-
pub static AWS_LAMBDA_DEPLOY_SPLAY_SECONDS: LazyLock<Duration> =
1053+
pub static AWS_LAMBDA_DEPLOY_SPLAY: LazyLock<Duration> =
10541054
LazyLock::new(|| Duration::from_secs(env_config("AWS_LAMBDA_DEPLOY_SPLAY_SECONDS", 5000)));
10551055

1056+
/// How long of a window to debounce static lambda deployments. Don't allow too
1057+
/// many static deploys in a small window to protect the infrastructure.
1058+
pub static AWS_LAMBDA_STATIC_DEBOUNCE_DELAY: LazyLock<Duration> = LazyLock::new(|| {
1059+
Duration::from_secs(env_config("AWS_LAMBDA_STATIC_DEBOUNCE_DELAY_SECONDS", 30))
1060+
});
1061+
10561062
/// The maximum number of requests to send using a single AWS Lambda client.
10571063
/// Empirical tests have shown that AWS servers allows up to 128 concurrent
10581064
/// streams over a single http2 connection.

crates/model/src/aws_lambda_versions/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub enum AwsLambdaPackageDesc {
5757
},
5858
}
5959

60-
#[derive(Clone, Copy, Debug)]
60+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
6161
pub enum AwsLambdaType {
6262
Static,
6363
Dynamic,

0 commit comments

Comments
 (0)