summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorYusuke Tanaka <yusuktan@maguro.dev>2024-08-27 16:30:19 +0900
committerGitHub <noreply@github.com>2024-08-27 00:30:19 -0700
commit9b4026563c38309229fcf802650fbd50436c70d8 (patch)
tree4407c6bafdc093e7b65eabb124af0f9ba7f5063f /runtime
parentc89a20b42899abff5c3ea84660c8110806c5fbee (diff)
feat(ext/kv): configurable limit params (#25174)
This commit makes various limit parameters in `deno_kv` configurable. Currently these values are declared as constants and thus can't be modified from outside. However, there may be situations where we want to change it. This commit makes this possible by introducing a new struct `KvConfig` that needs to be given as the 2nd param in `init_ops`.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/snapshot.rs7
-rw-r--r--runtime/web_worker.rs1
-rw-r--r--runtime/worker.rs1
3 files changed, 6 insertions, 3 deletions
diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs
index 659356ae6..fd422603f 100644
--- a/runtime/snapshot.rs
+++ b/runtime/snapshot.rs
@@ -244,9 +244,10 @@ pub fn create_runtime_snapshot(
deno_ffi::deno_ffi::init_ops_and_esm::<Permissions>(),
deno_net::deno_net::init_ops_and_esm::<Permissions>(None, None),
deno_tls::deno_tls::init_ops_and_esm(),
- deno_kv::deno_kv::init_ops_and_esm(deno_kv::sqlite::SqliteDbHandler::<
- Permissions,
- >::new(None, None)),
+ deno_kv::deno_kv::init_ops_and_esm(
+ deno_kv::sqlite::SqliteDbHandler::<Permissions>::new(None, None),
+ deno_kv::KvConfig::builder().build(),
+ ),
deno_cron::deno_cron::init_ops_and_esm(
deno_cron::local::LocalCronHandler::new(),
),
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 3e95045db..8178b93a8 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -480,6 +480,7 @@ impl WebWorker {
proxy: None,
},
),
+ deno_kv::KvConfig::builder().build(),
),
deno_cron::deno_cron::init_ops_and_esm(LocalCronHandler::new()),
deno_napi::deno_napi::init_ops_and_esm::<PermissionsContainer>(),
diff --git a/runtime/worker.rs b/runtime/worker.rs
index c1c918d08..c0d839166 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -404,6 +404,7 @@ impl MainWorker {
proxy: None,
},
),
+ deno_kv::KvConfig::builder().build(),
),
deno_cron::deno_cron::init_ops_and_esm(LocalCronHandler::new()),
deno_napi::deno_napi::init_ops_and_esm::<PermissionsContainer>(),