move the partition data migration to be a post-upgrade async process

this copies the approach we took with the bigint migration
This commit is contained in:
Ryan Petrello
2021-02-25 14:12:26 -05:00
committed by Jim Ladd
parent 67046513ae
commit c7ab3ea86e
5 changed files with 45 additions and 60 deletions

View File

@@ -310,9 +310,8 @@ class TaskManager:
def post_commit():
if task.status != 'failed' and type(task) is not WorkflowJob:
# Ensure that job event partition exists
create_partition('main_jobevent')
# Before task is dispatched, ensure that job_event partitions exist
create_partition(task.event_class._meta.db_table, start=task.created)
task_cls = task._get_task_class()
task_cls.apply_async(
[task.pk],