From 7a8b922841e6ee31f102cfdf84699976b538bcb9 Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Wed, 12 Aug 2020 12:40:22 -0700 Subject: [PATCH] [tune] hotfix log_once (#10069) --- python/ray/tune/suggest/suggestion.py | 2 +- python/ray/tune/syncer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ray/tune/suggest/suggestion.py b/python/ray/tune/suggest/suggestion.py index a6400edde..b18680e12 100644 --- a/python/ray/tune/suggest/suggestion.py +++ b/python/ray/tune/suggest/suggestion.py @@ -198,7 +198,7 @@ class Searcher: try: self.save(tmp_search_ckpt_path) except NotImplementedError: - with log_once("suggest:save_to_dir"): + if log_once("suggest:save_to_dir"): logger.warning( "save not implemented for Searcher. Skipping save.") success = False diff --git a/python/ray/tune/syncer.py b/python/ray/tune/syncer.py index 9b97fc31e..1ceaec242 100644 --- a/python/ray/tune/syncer.py +++ b/python/ray/tune/syncer.py @@ -44,7 +44,7 @@ def log_sync_template(options=""): unavailable. """ if not distutils.spawn.find_executable("rsync"): - with log_once("tune:rsync"): + if log_once("tune:rsync"): logger.error("Log sync requires rsync to be installed.") return None global _log_sync_warned