Function is_relayer_recently_synced

Source
pub async fn is_relayer_recently_synced(
    pool: &Arc<Pool>,
    prefix: &str,
    relayer_id: &str,
    threshold_secs: u64,
) -> Result<bool>
Expand description

Checks if a relayer was recently synced within the given threshold.

This is used to skip initialization for relayers that were recently initialized by another instance (e.g., during rolling restarts).

§Arguments

  • conn - Redis connection manager
  • prefix - Key prefix for multi-tenant support
  • relayer_id - The relayer’s unique identifier
  • threshold_secs - Number of seconds to consider as “recent”

§Returns

  • Ok(true) - If the relayer was synced within the threshold
  • Ok(false) - If the relayer was not synced or sync is stale
  • Err(_) - Redis communication error