Skip to content

Commit

Permalink
fix: params of celery function should be serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
GareArc committed Dec 21, 2024
1 parent 2fe742f commit 6d6d161
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/services/account_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def verify_account_deletion_code(token: str, code: str) -> bool:
@staticmethod
def delete_account(account: Account, reason="") -> None:
"""Delete account. This method only adds a task to the queue for deletion."""
delete_account_task.delay(account, reason)
delete_account_task.delay(account.id, reason)

@staticmethod
def link_account_integrate(provider: str, open_id: str, account: Account) -> None:
Expand Down
3 changes: 2 additions & 1 deletion api/tasks/delete_account_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@


@shared_task(queue="dataset")
def delete_account_task(account: Account, reason: str):
def delete_account_task(account_id, reason: str):
account = db.session.query(Account).filter(Account.id == account_id).first()
logger.info(click.style("Start delete account task.", fg="green"))
start_at = time.perf_counter()

Expand Down

0 comments on commit 6d6d161

Please sign in to comment.