diff --git a/pipelinewise/cli/pipelinewise.py b/pipelinewise/cli/pipelinewise.py index 711696d00..64559425a 100644 --- a/pipelinewise/cli/pipelinewise.py +++ b/pipelinewise/cli/pipelinewise.py @@ -959,19 +959,17 @@ def detect_tap_status(self, target_id, tap_id): } # Tap exists but configuration not completed - lock = self.get_lock(target_id, tap_id) if not os.path.isfile(connector_files['config']): status['currentStatus'] = 'not-configured' - # Configured and not running - elif lock.acquire(blocking=False): - lock.release() - status['currentStatus'] = 'ready' - # Tap exists and in running status - else: + elif self.get_lock(target_id, tap_id).locked(): status['currentStatus'] = 'running' + # Configured and not running + else: + status['currentStatus'] = 'ready' + # Get last run instance if os.path.isdir(log_dir): log_files = utils.search_log_files(