Staging instance, all changes can be removed at any time

Skip to content

save_origin_webhooks: Implement cooldown for creating save requests

Antoine Lambert requested to merge anlambert/swh-web:webhook-cooldown into master

In order to avoid abusing the archival service offered by Software Heritage or creating too many requests for the same origin in a short amount of time (when multiple commits are pushed in a row for instance), at most one request per hour for a given origin will be created. When a save request has been recently submitted from a webhook, a new one is created but its execution is delayed. Subsequent requests submitted before the delayed request execution will return the latter instead of creating a new request in swh-web database.

Related to #4548 (closed), #4731 (closed)

Depends on swh-scheduler!348 (merged)

This implementation takes another approach than !1135 (closed) (which returns 429 status code instead of delaying loading task execution).

I tested the changes in the docker environment and it works as expected.

Edited by Antoine Lambert

Merge request reports

Loading