We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94ac896 commit f5d25f0Copy full SHA for f5d25f0
torchx/util/session.py
@@ -17,10 +17,19 @@ def get_session_id_or_create_new() -> str:
17
"""
18
Returns the current session ID, or creates a new one if none exists.
19
The session ID remains the same as long as it is in the same process.
20
+ Please DO NOT use this function out of torchx codebase.
21
22
global CURRENT_SESSION_ID
23
if CURRENT_SESSION_ID:
24
return CURRENT_SESSION_ID
25
session_id = str(uuid.uuid4())
26
CURRENT_SESSION_ID = session_id
27
return session_id
28
+
29
30
+def get_torchx_session_id() -> Optional[str]:
31
+ """
32
+ Returns the torchx session ID.
33
+ Please use this function to get the session ID out of torchx codebase.
34
35
+ return CURRENT_SESSION_ID
0 commit comments