Skip to content

Commit 28c3f19

Browse files
committed
Cache
1 parent 5df41b8 commit 28c3f19

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/common/core/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def get_file_contents(file_path: str) -> str | None:
130130
return None
131131

132132

133+
@lru_cache()
133134
def is_database_replica_setup() -> bool:
134135
"""Checks if any database replica is set up"""
135136
return any(

tests/unit/common/core/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def test_is_database_replica_setup__tells_whether_any_replica_is_present(
223223
mocker: MockerFixture,
224224
) -> None:
225225
# Given
226+
is_database_replica_setup.cache_clear()
226227
mocker.patch(
227228
"common.core.utils.connections",
228229
{name: connections["default"] for name in database_names},

0 commit comments

Comments
 (0)