forked from MightyPork/group-actor
improvements, more config, add -q, readme
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct CommonConfig {
|
||||
/// Max number of missed notifs to process after connect
|
||||
pub max_catchup_notifs: usize,
|
||||
/// Max number of missed statuses to process after connect
|
||||
pub max_catchup_statuses: usize,
|
||||
/// Delay between fetched pages when catching up
|
||||
pub delay_fetch_page_s: f64,
|
||||
/// Delay after sending a status, making a follow or some other action.
|
||||
/// Set if there are Throttled errors and you need to slow the service down.
|
||||
pub delay_after_post_s: f64,
|
||||
/// Delay before trying to re-connect after the server closed the socket
|
||||
pub delay_reopen_closed_s: f64,
|
||||
/// Delay before trying to re-connect after an error
|
||||
pub delay_reopen_error_s: f64,
|
||||
/// Timeout for a notification/timeline socket to be considered alive.
|
||||
/// If nothing arrives in this interval, reopen it. Some servers have a buggy socket
|
||||
/// implementation where it stays open but no longer works.
|
||||
pub socket_alive_timeout_s: f64,
|
||||
/// Time after which a socket is always closed, even if seemingly alive.
|
||||
/// This is a work-around for servers that stop sending notifs after a while.
|
||||
pub socket_retire_time_s: f64,
|
||||
}
|
||||
|
||||
impl Default for CommonConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
max_catchup_notifs: 30,
|
||||
max_catchup_statuses: 50,
|
||||
delay_fetch_page_s: 0.25,
|
||||
delay_after_post_s: 0.0,
|
||||
delay_reopen_closed_s: 0.5,
|
||||
delay_reopen_error_s: 5.0,
|
||||
socket_alive_timeout_s: 30.0,
|
||||
socket_retire_time_s: 120.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user