• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

flamingo-run / django-cloud-tasks / 10293251638
87%

Build:
DEFAULT BRANCH: main
Ran 07 Aug 2024 11:32PM UTC
Jobs 2
Files 0
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Aug 2024 11:31PM UTC coverage: 0.0%. Remained the same
10293251638

push

github

joaodaher
feat: allow custom HTTP status codes when using DiscardTaskException

To prevent a Google Cloud Task from being retried, it is necessary to return a status code in the 200-299 range. The mechanism django_cloud_tasks currently offers for this is raising `DiscardTaskException`, but in this case the status code will always be HTTP 202 (Accepted). When we want to discard a task due to an unrecoverable error, this HTTP status code offers no good semantics. Also, from a monitoring perspective, simply discarding a task (perhaps it is no longer needed - for example: attempting to delete something that has already been deleted) and discarding a task due to an unrecoverable error (for example: the task input is invalid) are two different things, but we have no means to differentiate them if the status code is always the same.

This PR adds a bit of flexibility, allowing DiscardTaskException to receive an HTTP status code / HTTP status reason phrase as either constructor arguments, or by subclassing it and overriding default_http_status_code / default_http_status_reason.

This PR won't add a built-in "UnrecoverableTaskException" base class because there is no HTTP 2xx status code (even when considering augmented standards) to reflect this scenario, so we will leave it up to each project that uses django-cloud-tasks to configure this setup, as it will be project-specific by definition.

0 of 0 relevant lines covered (NaN%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10293251638.1 07 Aug 2024 11:32PM UTC 0
0.0
GitHub Action Run
2 10293251638.2 07 Aug 2024 11:32PM UTC 0
0.0
GitHub Action Run
Source Files on build 10293251638
Detailed source file information is not available for this build.
  • Back to Repo
  • 9c620ebd on github
  • Prev Build on main (#9766232913)
  • Next Build on main (#12242484361)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc