mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
scheduled_email: Only call .save() if necessary.
Calling `email.save()` is only needed if we altered `email.address`; it is unnecessary if we called `email.users.add(...)` which will have done its own INSERT.
This commit is contained in:
committed by
Tim Abbott
parent
d4f6b93859
commit
56344e4765
@@ -774,7 +774,7 @@ class LoginTest(ZulipTestCase):
|
|||||||
with queries_captured() as queries, cache_tries_captured() as cache_tries:
|
with queries_captured() as queries, cache_tries_captured() as cache_tries:
|
||||||
self.register(self.nonreg_email("test"), "test")
|
self.register(self.nonreg_email("test"), "test")
|
||||||
# Ensure the number of queries we make is not O(streams)
|
# Ensure the number of queries we make is not O(streams)
|
||||||
self.assert_length(queries, 89)
|
self.assert_length(queries, 87)
|
||||||
|
|
||||||
# We can probably avoid a couple cache hits here, but there doesn't
|
# We can probably avoid a couple cache hits here, but there doesn't
|
||||||
# seem to be any O(N) behavior. Some of the cache hits are related
|
# seem to be any O(N) behavior. Some of the cache hits are related
|
||||||
|
|||||||
@@ -771,7 +771,7 @@ class QueryCountTest(ZulipTestCase):
|
|||||||
acting_user=None,
|
acting_user=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assert_length(queries, 84)
|
self.assert_length(queries, 82)
|
||||||
self.assert_length(cache_tries, 27)
|
self.assert_length(cache_tries, 27)
|
||||||
|
|
||||||
peer_add_events = [event for event in events if event["event"].get("op") == "peer_add"]
|
peer_add_events = [event for event in events if event["event"].get("op") == "peer_add"]
|
||||||
|
|||||||
Reference in New Issue
Block a user