mirror of https://github.com/zulip/zulip.git
1198785c62
The previous implementation using Django's `get_or_create` for `do_increment_logging_stat` involved two separate database queries, potentially leading to race conditions. Use an `ON CONFLICT ... DO UPDATE` (aka "upsert") query, which eliminates race conditions and improves performance. This is mildly complicated due to the different unique indexes across the various tables, and the need for bug-for-bug compatibility with the previous implementation. Fixes #28947. Co-authored-by: Alex Vandiver <alexmv@zulip.com> |
||
---|---|---|
.. | ||
__init__.py | ||
test_counts.py | ||
test_fixtures.py | ||
test_stats_views.py |