Avoiding duplicate on_commit actions

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Avoiding duplicate on_commit actions

Steve Jorgensen
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.

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4b4e3544-3e50-4c10-bc68-2b31a73069b0n%40googlegroups.com.