Why should webhook handlers respond fast and process asynchronously?
AdvancedConceptTesting, services & metrics
Answer
Senders have short timeouts (GitHub waits 10 seconds) and may retry or mark the delivery failed. If the handler runs a deployment inline, the request times out, the sender redelivers, and you deploy twice. Pattern: validate the signature, persist or enqueue the event (SQS, Redis, a DB table), return 2xx immediately, and process in a worker that is idempotent keyed on the delivery ID.
More on Testing, services & metrics
Why should automation scripts have tests at all?BeginnerHow does pytest discover and run tests?BeginnerWhy does pytest use plain `assert` instead of `assertEqual`?BeginnerWhat are pytest fixtures, and what scopes exist?IntermediateWhat built-in fixtures do you use most?IntermediateHow does `@pytest.mark.parametrize` work?Beginner