Limit amount of HTTP requests to handle activities (fixes #1221) #117
Loading…
Reference in New Issue
No description provided.
Delete Branch "request-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I tested this by using some different limits. With
MAX_REQUEST_NUMBER=1
, all the tests fail, as expected.MAX_REQUEST_NUMBER=5
is the lowest value where all the tests are passing.@ -48,0 +53,4 @@
async fn fetch_remote_object<Response>(
client: &Client,
url: &Url,
recursion_counter: &mut i32,
Might be better as an option, but this is fine.
@ -101,3 +101,3 @@
check_is_apub_id_valid(&actor_id)?;
let actor = get_or_fetch_and_upsert_actor(&actor_id, &context).await?;
let request_counter = &mut 0;
Something tells me there's a smart way to do this, by providing a
None
for the first fetch, then checking for a None and making it a zero, otherwise incrementing. But this works.Then we need to handle that in a lot more functions, here we only have to initialise the counter in 5 places iirc. Plus its easier to see where the counters are started.