Skip to main content

ReloadRefreshStatus

Enum ReloadRefreshStatus 

Source
pub enum ReloadRefreshStatus {
    NeverRun,
    Running {
        started_ms: u64,
    },
    Succeeded {
        finished_ms: u64,
        refreshed: bool,
    },
    Failed {
        finished_ms: u64,
        error: String,
    },
    Skipped {
        finished_ms: u64,
        reason: String,
    },
    NotApplicable {
        finished_ms: u64,
    },
}
Expand description

v1.4.106 codex 0554 F3 [P2]: /api/admin/reload 两阶段拆分后, 后台 credentials refresh 任务的状态机。

背景: v1.4.34 之前 reload() 是同步组合: 清 cipher → POST /authority/ 刷 tgtgt → 写盘 → return. 网络 I/O 几秒, axum handler 整段 await 期间客户端 hang. 用户报告“reload 偶尔超时但 cipher 已清“ 状态不可见 (response 没回 → 不知道 cipher 已清没).

v1.4.106 拆: 阶段 1 (sync) 立即清 cipher + bump version → return ok; 阶段 2 (async, spawn) 后台跑 refresh_credentials_on_disk, 状态写 last_reload_refresh, /api/admin/status 暴露给 ops 看进度.

6 状态机:

  • NeverRun: 自启动以来从没调过 reload (status=null, 也是 Default)
  • Running { started_ms }: refresh 任务在跑 (sync clear 已完成)
  • Succeeded { finished_ms, refreshed }: 上一次 refresh 成功
  • Failed { finished_ms, error }: 上一次 refresh 报错 (cipher 仍已清)
  • Skipped { finished_ms, reason }: 没 reload_state (offline mode 启动 / 无凭据)
  • NotApplicable { finished_ms }: refresh helper 报 “credentials already fresh” (有些 backend 路径不需要刷, 直接 OK)

Variants§

§

NeverRun

§

Running

Fields

§started_ms: u64
§

Succeeded

Fields

§finished_ms: u64
§refreshed: bool
§

Failed

Fields

§finished_ms: u64
§error: String
§

Skipped

Fields

§finished_ms: u64
§reason: String
§

NotApplicable

Fields

§finished_ms: u64

Trait Implementations§

Source§

impl Clone for ReloadRefreshStatus

Source§

fn clone(&self) -> ReloadRefreshStatus

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReloadRefreshStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReloadRefreshStatus

Source§

fn default() -> ReloadRefreshStatus

Returns the “default value” for a type. Read more
Source§

impl Serialize for ReloadRefreshStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more