-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 通过REST API占用设备并获取远程,不能立即使用连接 #368
Labels
bug
Something isn't working
Comments
这还真不太好做,,不错的建议。我看看怎么优化比较好
|
采用了client 轮询的方式临时解决了 def wait_remote_server_ready(remote_url, timeout=30):
"""等待远程服务准备好"""
time_start = time.time()
while time.time() - time_start <= timeout:
time.sleep(1)
logger.debug('check remote server status...')
response = request_with_proxy('GET', remote_url + '/status')
if response.status_code != 200:
continue
result = response.json()
if result.get('value', {}).get('ready'):
logger.info(f'{result["value"].get("message")}')
return
raise TimeoutError('wait remote server ready timeout') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Sonic version
2.6.1
Deploy platform
Macosx
Minimal reproduce step
获取 uia2 地址需要强制等待设备 server 启动完成,建议这里做成阻塞式接口或能获取是否启动完成的状态,避免脚本强制等待一个时间
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: