pub struct DbMaintenanceTask {
pub notify_tn: Option<TnId>,
}Expand description
Meta-database maintenance. Scheduled via cron at process start, and on
demand from POST /api/admin/db-maintenance.
Fields§
§notify_tn: Option<TnId>Tenant to push the outcome to when the sweep ends. None — the nightly
run — stays silent: nobody asked for it, so nobody is waiting.
Not serialized, so it is not part of the task’s stored parameters.
The sweep is node-wide; which tenant happened to press the button is a
property of this request, not of the work. Serialized, two tenants
triggering the same core.db_maintenance:manual key would produce two
different parameter strings and send the scheduler down its “parameters
changed” path. Identical parameters take the “already exists” branch and
hand the second caller the running task’s id.
The cost is that a task rebuilt from its persisted row after a restart notifies nobody. That is the right outcome anyway: the browser that asked is long gone, and the notification is fire-and-forget.
Trait Implementations§
Source§impl Debug for DbMaintenanceTask
impl Debug for DbMaintenanceTask
Source§impl Default for DbMaintenanceTask
impl Default for DbMaintenanceTask
Source§fn default() -> DbMaintenanceTask
fn default() -> DbMaintenanceTask
Source§impl<'de> Deserialize<'de> for DbMaintenanceTask
impl<'de> Deserialize<'de> for DbMaintenanceTask
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>,
Source§impl Serialize for DbMaintenanceTask
impl Serialize for DbMaintenanceTask
Source§impl Task<Arc<AppState>> for DbMaintenanceTask
impl Task<Arc<AppState>> for DbMaintenanceTask
fn kind() -> &'static str
fn kind_of(&self) -> &'static str
fn build(_id: TaskId, ctx: &str) -> ClResult<Arc<dyn Task<App>>>
fn serialize(&self) -> String
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
app: &'life1 App,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn on_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 S,
_attempts: u16,
_last_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 S,
_attempts: u16,
_last_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Failed after exhausting retries
(or on the very first failure when no retry policy is set). Lets the
task perform irreversible cleanup — e.g. mark a related domain row as
permanently failed — that should not happen on retryable failures.
Default: no-op.Source§fn on_attempt_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 S,
_attempt: u16,
_last_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_attempt_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 S,
_attempt: u16,
_last_error: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for DbMaintenanceTask
impl RefUnwindSafe for DbMaintenanceTask
impl Send for DbMaintenanceTask
impl Sync for DbMaintenanceTask
impl Unpin for DbMaintenanceTask
impl UnsafeUnpin for DbMaintenanceTask
impl UnwindSafe for DbMaintenanceTask
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().