pub struct SearchIndexJob {
pub tenant_slug: String,
pub action: SearchIndexAction,
}Expand description
Keep an external crate::search::SearchBackend (Elasticsearch) in
sync with a page change. A no-op at run time when no backend
is installed — the built-in Postgres FTS path queries live data and
needs no index. Retriable: an ES hiccup is retried rather than
silently dropping the update.
Fields§
§tenant_slug: String§action: SearchIndexActionTrait Implementations§
Source§impl Clone for SearchIndexJob
impl Clone for SearchIndexJob
Source§impl Debug for SearchIndexJob
impl Debug for SearchIndexJob
Source§impl<'de> Deserialize<'de> for SearchIndexJob
impl<'de> Deserialize<'de> for SearchIndexJob
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Job for SearchIndexJob
impl Job for SearchIndexJob
Source§const NAME: &'static str = "rcms.search_index"
const NAME: &'static str = "rcms.search_index"
Stable identifier for this job kind. Routes payloads to handlers.
Source§fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the job. Return
Ok(()) on success, Err(Retryable(_)) to
retry with backoff, Err(Fatal(_)) to dead-letter at once. Read moreSource§const MAX_ATTEMPTS: u32 = 5
const MAX_ATTEMPTS: u32 = 5
Cap on total runs, not extra retries. The default of 5 is
one run plus four retries; 3 gives two retries. 0 counts as 1.
Source§fn retry_backoff(failed_attempt: u32) -> Duration
fn retry_backoff(failed_attempt: u32) -> Duration
Wait before the retry after run
failed_attempt (0 is the first
run). The default is 1s doubling; override it to ride out longer outages.Auto Trait Implementations§
impl Freeze for SearchIndexJob
impl RefUnwindSafe for SearchIndexJob
impl Send for SearchIndexJob
impl Sync for SearchIndexJob
impl Unpin for SearchIndexJob
impl UnsafeUnpin for SearchIndexJob
impl UnwindSafe for SearchIndexJob
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.