Skip to content

Add a settings flag to enable/disable durable checks #163

@kondratevdev

Description

@kondratevdev

Hi! Thanks for django-subatomic - it has been very useful in our project!

We’d like to request a built-in settings flag to toggle durable.

Current behavior

durable is always active once applied as a decorator.

Why this is needed

durable is an excellent strict guard for development/CI, but in production it can be too strict as always-on runtime behavior:

  • it adds transaction-state checks around each decorated call;
  • on failure, it raises immediately (which is correct semantically), but in production this can translate into user-facing request/job failures;

At the moment, we solve this with a local wrapper and project-level feature flag.

Proposal

Add an optional setting in the library, for example:

  • SUBATOMIC_DURABLE_ENABLED (default True for backward compatibility)

Expected behavior:

  • if True: keep current durable behavior unchanged;
  • if False: return the original function (no durable guard checks).

This would let teams control strictness per environment without maintaining custom wrappers in every codebase.

As a follow-up: the same kind of toggle would also be very useful for transaction_required.

If this direction is approved, I can implement it and open a PR :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions