Skip to content

Commit c3bc470

Browse files
committed
use progress bar wrapper
1 parent 60761e2 commit c3bc470

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/sentry/migrations/0726_apitoken_backfill_hashes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from django.db.migrations.state import StateApps
99

1010
from sentry.new_migrations.migrations import CheckedMigration
11+
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
1112

1213
logger = logging.getLogger(__name__)
1314

@@ -23,7 +24,7 @@ def backfill_hash_values(apps: StateApps, schema_editor: BaseDatabaseSchemaEdito
2324
logger.exception("Cannot execute migration. Required symbols could not be imported")
2425
return
2526

26-
for api_token in ApiToken.objects.all():
27+
for api_token in RangeQuerySetWrapperWithProgressBar(ApiToken.objects.all()):
2728
hashed_token = None
2829
if api_token.hashed_token is None:
2930
hashed_token = hashlib.sha256(api_token.token.encode()).hexdigest()

0 commit comments

Comments
 (0)