save_origin_webhooks: Implement cooldown for creating save requests
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.
Merge request reports
Activity
Jenkins job DWAPPS/gitlab-builds #175 failed .
See Console Output and Coverage Report for more details.Build will fail until swh-scheduler!348 (merged) merged and tagged.
added 8 commits
-
ceaf8a1d...a699fdd0 - 6 commits from branch
swh/devel:master
- 6d41c035 - save_origin_webhooks: Implement cooldown for creating save requests
- be544aef - Rename constant and make its value configurable
-
ceaf8a1d...a699fdd0 - 6 commits from branch
mentioned in issue swh/infra/sysadm-environment#4933 (closed)
added 1 commit
- 2c24b6f6 - requirements-swh: Bump swh.scheduler to 1.9.1
Jenkins job DWAPPS/gitlab-builds #187 succeeded .
See Console Output and Coverage Report for more details.Jenkins job DWAPPS/gitlab-builds #188 succeeded .
See Console Output and Coverage Report for more details.mentioned in issue #4548 (closed)
mentioned in merge request !1135 (closed)