fix(workers): snooze incoming jobs while a host is backed off
With 5 attempts and Oban's short retry delays, an incoming activity from an unknown actor on a backed-off host was discarded without a request. ReceiverWorker and SignatureRetryWorker now snooze for up to 2 hours. Also lowercase backoff host keys and log backed-off user fetches at debug.
This commit is contained in:
parent
8ce283f966
commit
b29d9d0981
8 changed files with 97 additions and 13 deletions
|
|
@ -67,6 +67,15 @@ defmodule Pleroma.HTTP.BackoffTest do
|
|||
assert_ttl_about(300)
|
||||
end
|
||||
|
||||
test "treats host names case-insensitively" do
|
||||
mock_response(429)
|
||||
assert {:error, :ratelimit} = Backoff.get("https://RateLimited.Example.com/users/alice")
|
||||
assert_received :request
|
||||
|
||||
assert {:error, :ratelimit} = Backoff.get(@url)
|
||||
refute_received :request
|
||||
end
|
||||
|
||||
test "only backs off from the host that answered" do
|
||||
mock_response(429)
|
||||
assert {:error, :ratelimit} = Backoff.get(@url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue