mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
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 | ||
| counts.py | ||
| fixtures.py | ||
| time_utils.py | ||