[Bf-blender-cvs] [684d870dc46] soc-2017-package_manager: Replace hardcoded 10s with constant
gandalf3
noreply at git.blender.org
Tue Aug 29 11:45:39 CEST 2017
Commit: 684d870dc46bdd8fb77a616483a36aff255f50a1
Author: gandalf3
Date: Mon Aug 28 21:10:08 2017 -0700
Branches: soc-2017-package_manager
https://developer.blender.org/rB684d870dc46bdd8fb77a616483a36aff255f50a1
Replace hardcoded 10s with constant
===================================================================
M release/scripts/startup/bl_operators/package.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/package.py b/release/scripts/startup/bl_operators/package.py
index 9cb515f4175..ee32c31dac1 100644
--- a/release/scripts/startup/bl_operators/package.py
+++ b/release/scripts/startup/bl_operators/package.py
@@ -37,6 +37,7 @@ else:
log = logging.getLogger(__name__ + '.SubprocMixin')
_state = 'INITIALIZING'
_abort_timeout = 0 # time at which we stop waiting for an abort response and just terminate the process
+ _abort_wait = 10 # how long to wait (in seconds) to forcibly terminate subprocess after quit
# Mapping from message type (see bpkg.messages) to handler function.
# Should be constructed before modal() gets called.
@@ -98,7 +99,7 @@ else:
import time
# Allow the subprocess 10 seconds to repsond to our abort message.
- self._abort_timeout = time.time() + 10
+ self._abort_timeout = time.time() + self._abort_wait
self._state = 'ABORTING'
self.pipe_blender.send(messages.Abort())
@@ -117,7 +118,7 @@ else:
if self.process and self.process.is_alive():
self.log.debug('Waiting for subprocess to quit')
try:
- self.process.join(timeout=10)
+ self.process.join(timeout=self._abort_wait)
except multiprocessing.TimeoutError:
self.log.warning('Subprocess is hanging, terminating it forcefully.')
self.process.terminate()
More information about the Bf-blender-cvs
mailing list