Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 0600a7e

Browse files
author
Teodor Yanev
committed
read the development environment flag once at module level
1 parent 99d87bd commit 0600a7e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/codegate/updates/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
__update_client_singleton = None
1111

12+
is_dev_env = bool(os.environ.get("CODEGATE_DEV_ENV"))
1213

1314
# Enum representing whether the request is coming from the front-end or the back-end.
1415
class Origin(Enum):
@@ -28,7 +29,7 @@ def get_latest_version(self, origin: Origin) -> str:
2829
"""
2930

3031
user_agent = f"codegate/{self.__current_version} {origin.value}"
31-
if os.environ.get("CODEGATE_DEV_ENV"):
32+
if is_dev_env:
3233
user_agent += "-dev"
3334
headers = {
3435
"X-Instance-ID": self.__instance_id,

0 commit comments

Comments
 (0)