Skip to main content

xmtp_mls_core/
reconnect.rs

1use xmtp_common::time::Duration;
2
3#[cfg_attr(not(target_arch = "wasm32"), trait_variant::make(NeedsDbReconnect: Send + Sync))]
4#[cfg_attr(target_arch = "wasm32", trait_variant::make(NeedsDbReconnect: xmtp_common::Wasm))]
5pub trait LocalNeedsDbReconnect: std::error::Error {
6    fn needs_db_reconnect(&self) -> bool;
7
8    /// The least time to wait before restarting a worker that failed with
9    /// this error: a rate-limit rejection's delay (RATE-041).
10    fn restart_delay(&self) -> Option<Duration> {
11        None
12    }
13}