warden-worker/src/handlers/mod.rs

24 lines
661 B
Rust

pub mod accounts;
pub mod ciphers;
pub mod config;
pub mod devices;
pub mod emergency_access;
pub mod folders;
pub mod identity;
pub mod import;
pub mod purge;
pub mod sync;
pub mod webauth;
/// Shared helper for reading an environment variable into usize.
pub(crate) fn get_env_usize(env: &worker::Env, var_name: &str, default: usize) -> usize {
env.var(var_name)
.ok()
.and_then(|value| value.to_string().parse::<usize>().ok())
.unwrap_or(default)
}
/// Convenience helper for cipher batch size using IMPORT_BATCH_SIZE.
pub(crate) fn get_batch_size(env: &worker::Env) -> usize {
get_env_usize(env, "IMPORT_BATCH_SIZE", 30)
}