Skip to content

Commit 48e95bf

Browse files
authored
perf: make reversion_version table deletion faster (#6493)
### 📣 Summary Improve background maintenance by making cleanup of the reversion_version table significantly faster.
1 parent 1182550 commit 48e95bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kobo/apps/long_running_migrations/jobs/0012_remove_old_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ def run():
1515
deleted = queryset.delete()
1616
# log at debug level so we don't flood the logs
1717
logging.debug(f'Deleted {deleted[0]} version objects with pk < {min_id}')
18-
time.sleep(10)
18+
time.sleep(2)

kobo/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,7 @@ def dj_stripe_request_callback_method():
21002100
USER_ASSET_ORG_TRANSFER_BATCH_SIZE = 1000
21012101
SUBMISSION_DELETION_BATCH_SIZE = 1000
21022102
LONG_RUNNING_MIGRATION_BATCH_SIZE = 2000
2103-
VERSION_DELETION_BATCH_SIZE = 1000
2103+
VERSION_DELETION_BATCH_SIZE = 2000
21042104

21052105
# Number of stuck tasks should be restarted at a time
21062106
MAX_RESTARTED_TASKS = 100

0 commit comments

Comments
 (0)