Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Add `clear_client_cache` function to clear `get_client_cache`.

Riken Shahb8691fb2523f
diff --git a/zerver/models.py b/zerver/models.py
index faa808e6033..16ac433d9c9 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -1821,6 +1821,11 @@ class Client(models.Model):
get_client_cache: Dict[str, Client] = {}
+def clear_client_cache() -> None: # nocoverage
+ global get_client_cache
+ get_client_cache = {}
+
+
def get_client(name: str) -> Client:
# Accessing KEY_PREFIX through the module is necessary
# because we need the updated value of the variable.