提交 3431d0a8 编写于 作者: S shenyuhan

fix:1.Catch exception update_cache;2.add name&version hub run

上级 c166401b
......@@ -287,7 +287,10 @@ class CacheUpdater(threading.Thread):
"command": "update_cache",
"mtime": os.stat(cache_path).st_mtime
}
r = srv_utils.hub_request(api_url, payload, extra)
try:
r = srv_utils.hub_request(api_url, payload, extra)
except Exception as err:
pass
if r.get("update_cache", 0) == 1:
with open(cache_path, 'w+') as fp:
yaml.safe_dump({'resource_list': r['data']}, fp)
......
......@@ -128,6 +128,8 @@ class Module(object):
elif module_dir:
self._init_with_module_file(module_dir=module_dir[0])
lock.flock(fp_lock, lock.LOCK_UN)
name = module_dir[0].split("/")[-1]
version = module_dir[1]
elif signatures:
if processor:
if not issubclass(processor, BaseProcessor):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册