[tune] check for running session (#10840)

This commit is contained in:
Richard Liaw
2020-09-16 18:55:11 -07:00
committed by GitHub
parent 829a2307df
commit d3feb83053
3 changed files with 24 additions and 5 deletions
+6
View File
@@ -7,6 +7,12 @@ logger = logging.getLogger(__name__)
_session = None
def is_session_enabled() -> bool:
"""Returns True if running within an Tune process."""
global _session
return _session is not None
def get_session():
global _session
if not _session: