mirror of https://github.com/databricks/cli.git
lint
This commit is contained in:
parent
c898aafbed
commit
eb2b18721d
|
@ -5,8 +5,9 @@ import time
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def wait_pid(pid):
|
def wait_pid(pid):
|
||||||
max_attempts = 600 # 600 * 0.1 seconds = 1 minute
|
max_attempts = 600 # 600 * 0.1 seconds = 1 minute
|
||||||
sleep_time = 0.1
|
sleep_time = 0.1
|
||||||
|
|
||||||
for i in range(max_attempts):
|
for i in range(max_attempts):
|
||||||
|
@ -15,7 +16,7 @@ def wait_pid(pid):
|
||||||
# Windows approach: use tasklist to check for the existence of the process.
|
# Windows approach: use tasklist to check for the existence of the process.
|
||||||
try:
|
try:
|
||||||
# Get the output of 'tasklist'
|
# Get the output of 'tasklist'
|
||||||
output = subprocess.check_output(['tasklist'], text=True)
|
output = subprocess.check_output(["tasklist"], text=True)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print("[wait_pid] Error retrieving tasklist. Assuming process has ended.")
|
print("[wait_pid] Error retrieving tasklist. Assuming process has ended.")
|
||||||
return 0
|
return 0
|
||||||
|
@ -37,6 +38,7 @@ def wait_pid(pid):
|
||||||
print(f"Timeout: Process {pid} did not end within 1 minute")
|
print(f"Timeout: Process {pid} did not end within 1 minute")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pid = int(sys.argv[1])
|
pid = int(sys.argv[1])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in New Issue