Skip to main content

mirror_central_kv_once

Function mirror_central_kv_once 

Source
pub(crate) async fn mirror_central_kv_once(
    sync_cfg: &CentralKvSyncConfig,
    local_store: &Store,
    local_key: &str,
) -> Result<bool, LJMError>
Expand description

Performs one central-to-local KV mirror pass during streamer bootstrap.

Connects to central NATS, opens (or creates) the central bucket, and copies the configured key into local KV with mirror_remote_kv_entry_to_local. The connection is dropped afterward; run_central_kv_sync keeps its own.

§Arguments

  • sync_cfg - Central connection and key details.
  • local_store - Local KV bucket to write into.
  • local_key - Local configuration key.

§Returns

true if the local entry was written, false if it already matched.

§Errors

Returns an error if the connection, bucket setup, or mirror step fails.