mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat: Soft kill kv (#4582)
Co-authored-by: Akshay S <akshay.s@Akshay-Subramanian-D66TQ6D97K.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -151,6 +151,7 @@ pub struct KVRouterStore<T: DatabaseStore> {
|
||||
drainer_num_partitions: u8,
|
||||
ttl_for_kv: u32,
|
||||
pub request_id: Option<String>,
|
||||
soft_kill_mode: bool,
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@ -159,14 +160,16 @@ where
|
||||
RouterStore<T>: DatabaseStore,
|
||||
T: DatabaseStore,
|
||||
{
|
||||
type Config = (RouterStore<T>, String, u8, u32);
|
||||
type Config = (RouterStore<T>, String, u8, u32, Option<bool>);
|
||||
async fn new(config: Self::Config, _test_transaction: bool) -> StorageResult<Self> {
|
||||
let (router_store, drainer_stream_name, drainer_num_partitions, ttl_for_kv) = config;
|
||||
let (router_store, drainer_stream_name, drainer_num_partitions, ttl_for_kv, soft_kill_mode) =
|
||||
config;
|
||||
Ok(Self::from_store(
|
||||
router_store,
|
||||
drainer_stream_name,
|
||||
drainer_num_partitions,
|
||||
ttl_for_kv,
|
||||
soft_kill_mode,
|
||||
))
|
||||
}
|
||||
fn get_master_pool(&self) -> &PgPool {
|
||||
@ -191,6 +194,7 @@ impl<T: DatabaseStore> KVRouterStore<T> {
|
||||
drainer_stream_name: String,
|
||||
drainer_num_partitions: u8,
|
||||
ttl_for_kv: u32,
|
||||
soft_kill: Option<bool>,
|
||||
) -> Self {
|
||||
let request_id = store.request_id.clone();
|
||||
|
||||
@ -200,6 +204,7 @@ impl<T: DatabaseStore> KVRouterStore<T> {
|
||||
drainer_num_partitions,
|
||||
ttl_for_kv,
|
||||
request_id,
|
||||
soft_kill_mode: soft_kill.unwrap_or(false),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user