mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-31 20:28:31 +00:00
general misc bug fixes and slight improvements
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
fd2a002480
commit
4f0bdb5194
10 changed files with 127 additions and 100 deletions
|
@ -39,7 +39,7 @@ impl super::Service {
|
|||
.forbidden_remote_server_names
|
||||
.contains(dest)
|
||||
{
|
||||
return Err!(Request(Forbidden(debug_warn!("Federation with this {dest} is not allowed."))));
|
||||
return Err!(Request(Forbidden(debug_warn!("Federation with {dest} is not allowed."))));
|
||||
}
|
||||
|
||||
let actual = self.services.resolver.get_actual_dest(dest).await?;
|
||||
|
|
|
@ -235,13 +235,15 @@ impl Service {
|
|||
fn select_events_current(&self, dest: Destination, statuses: &mut CurTransactionStatus) -> Result<(bool, bool)> {
|
||||
let (mut allow, mut retry) = (true, false);
|
||||
statuses
|
||||
.entry(dest)
|
||||
.entry(dest.clone()) // TODO: can we avoid cloning?
|
||||
.and_modify(|e| match e {
|
||||
TransactionStatus::Failed(tries, time) => {
|
||||
// Fail if a request has failed recently (exponential backoff)
|
||||
let min = self.server.config.sender_timeout;
|
||||
let max = self.server.config.sender_retry_backoff_limit;
|
||||
if continue_exponential_backoff_secs(min, max, time.elapsed(), *tries) {
|
||||
if continue_exponential_backoff_secs(min, max, time.elapsed(), *tries)
|
||||
&& !matches!(dest, Destination::Appservice(_))
|
||||
{
|
||||
allow = false;
|
||||
} else {
|
||||
retry = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue