Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix/run_project_name
Browse files Browse the repository at this point in the history
  • Loading branch information
raubitsj committed Jul 29, 2020
2 parents 5e957d9 + 75046e7 commit 9cbe219
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions wandb/sdk/wandb_run.py
Expand Up @@ -571,12 +571,12 @@ def restore(
return None
return files[0].download(root=root, replace=True)

def join(self):
def join(self, exit_code=None):
"""Marks a run as finished, and finishes uploading all data. This is
used when creating multiple runs in the same process. We automatically
call this method when your script exits.
"""
self._atexit_cleanup()
self._atexit_cleanup(exit_code=exit_code)
if len(self._wl._global_run_stack) > 0:
self._wl._global_run_stack.pop()

Expand Down Expand Up @@ -684,15 +684,15 @@ def _restore(self):
sys.stderr = self._save_stderr
logger.info("restore done")

def _atexit_cleanup(self):
def _atexit_cleanup(self, exit_code=None):
if self._backend is None:
logger.warning("process exited without backend configured")
return False
if self._atexit_cleanup_called:
return
self._atexit_cleanup_called = True

exit_code = self._hooks.exit_code if self._hooks else 0
exit_code = exit_code or self._hooks.exit_code if self._hooks else 0
logger.info("got exitcode: %d", exit_code)
ret = self._backend.interface.send_exit_sync(exit_code, timeout=60)
logger.info("got exit ret: %s", ret)
Expand Down
8 changes: 4 additions & 4 deletions wandb/sdk_py27/wandb_run.py
Expand Up @@ -571,12 +571,12 @@ def restore(
return None
return files[0].download(root=root, replace=True)

def join(self):
def join(self, exit_code=None):
"""Marks a run as finished, and finishes uploading all data. This is
used when creating multiple runs in the same process. We automatically
call this method when your script exits.
"""
self._atexit_cleanup()
self._atexit_cleanup(exit_code=exit_code)
if len(self._wl._global_run_stack) > 0:
self._wl._global_run_stack.pop()

Expand Down Expand Up @@ -684,15 +684,15 @@ def _restore(self):
sys.stderr = self._save_stderr
logger.info("restore done")

def _atexit_cleanup(self):
def _atexit_cleanup(self, exit_code=None):
if self._backend is None:
logger.warning("process exited without backend configured")
return False
if self._atexit_cleanup_called:
return
self._atexit_cleanup_called = True

exit_code = self._hooks.exit_code if self._hooks else 0
exit_code = exit_code or self._hooks.exit_code if self._hooks else 0
logger.info("got exitcode: %d", exit_code)
ret = self._backend.interface.send_exit_sync(exit_code, timeout=60)
logger.info("got exit ret: %s", ret)
Expand Down

0 comments on commit 9cbe219

Please sign in to comment.