Skip to content

Commit

Permalink
fixup! Add support for retries
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofern committed Sep 16, 2024
1 parent 2b280ca commit 2449e41
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _validate(self) -> None:

def _migrate(self, *django_migrate_args: Any, **django_migrate_kwargs: Any) -> None:
migration_applied: bool = False
while self._can_migrate() and (migration_applied is False):
while self._can_migrate() and (not migration_applied):
try:
with timeouts.apply_timeouts(
using=django_migrate_kwargs["database"],
Expand All @@ -195,7 +195,7 @@ def _migrate(self, *django_migrate_args: Any, **django_migrate_kwargs: Any) -> N
)
self._attempt_callback(exc)

if migration_applied is False:
if not migration_applied:
raise base.CommandError(
f"Please consider trying a longer retry configuration or "
f"investigate whether there were long-running transactions "
Expand Down

0 comments on commit 2449e41

Please sign in to comment.