mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 17:03:59 +00:00
27 lines
989 B
Rust
27 lines
989 B
Rust
|
use crate::newtypes::{ActivityId, InstanceId};
|
||
|
use chrono::{DateTime, Utc};
|
||
|
#[cfg(feature = "full")]
|
||
|
use diesel::prelude::*;
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
#[cfg(feature = "full")]
|
||
|
use ts_rs::TS;
|
||
|
|
||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||
|
#[cfg_attr(
|
||
|
feature = "full",
|
||
|
derive(Queryable, Selectable, Insertable, AsChangeset)
|
||
|
)]
|
||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||
|
#[cfg_attr(feature = "full", diesel(table_name = crate::schema::federation_queue_state))]
|
||
|
#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))]
|
||
|
pub struct FederationQueueState {
|
||
|
pub instance_id: InstanceId,
|
||
|
/// the last successfully sent activity id
|
||
|
pub last_successful_id: Option<ActivityId>,
|
||
|
pub last_successful_published_time: Option<DateTime<Utc>>,
|
||
|
/// how many failed attempts have been made to send the next activity
|
||
|
pub fail_count: i32,
|
||
|
/// timestamp of the last retry attempt (when the last failing activity was resent)
|
||
|
pub last_retry: Option<DateTime<Utc>>,
|
||
|
}
|