Avoiding duplicate on_commit actions

42 views
Skip to first unread message

Steve Jorgensen

unread,
Oct 22, 2020, 5:27:51 PM10/22/20
to Django users
Hi all,

If a record is updated more than once in a transaction causing something to need to happen on commit, but don't want to suffer the performance cost of unnecessarily doing that post-commit activity multiple times, is there any clean way to de-duplicate that?

If on_commit has an optional key argument to have it replace any entry with the same key rather than adding it again, that would solve this problem nicely. Of course, on_commit does not appear to have anything like that.

Reply all
Reply to author
Forward
0 new messages