mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
applist
This commit is contained in:
parent
6f62502488
commit
722a7d8922
@ -28,26 +28,25 @@ redis_conn = Redis(host='websoft9-redis', port=6379)
|
|||||||
# 使用指定的 Redis 连接创建 RQ 队列
|
# 使用指定的 Redis 连接创建 RQ 队列
|
||||||
q = Queue(connection=redis_conn,default_timeout=3600)
|
q = Queue(connection=redis_conn,default_timeout=3600)
|
||||||
|
|
||||||
# APP列表是否有正在安装的应用
|
def conbine_list(installing_list, installed_list):
|
||||||
def check_list_status(applist):
|
app_list = installing_list + installed_list
|
||||||
installing = False
|
result_list = []
|
||||||
for app in applist:
|
appid_list = []
|
||||||
status = app['status']
|
for app in app_list:
|
||||||
if status == "created":
|
app_id = app['app_id']
|
||||||
installing = True
|
if app_id in appid_list:
|
||||||
break
|
continue
|
||||||
return installing
|
else:
|
||||||
|
appid_list.append(app_id)
|
||||||
|
result_list.append(app)
|
||||||
|
return result_list
|
||||||
|
|
||||||
# 获取所有app的信息
|
# 获取所有app的信息
|
||||||
def get_my_app(app_id):
|
def get_my_app(app_id):
|
||||||
installed_list = get_apps_from_compose()
|
installed_list = get_apps_from_compose()
|
||||||
installing_list = get_apps_from_queue()
|
installing_list = get_apps_from_queue()
|
||||||
|
|
||||||
if check_list_status(installed_list):
|
app_list = conbine_list(installing_list, installed_list)
|
||||||
time.sleep(3)
|
|
||||||
installed_list = get_apps_from_compose()
|
|
||||||
|
|
||||||
app_list = installing_list + installed_list
|
|
||||||
find = False
|
find = False
|
||||||
ret = {}
|
ret = {}
|
||||||
if app_id != None:
|
if app_id != None:
|
||||||
|
Loading…
Reference in New Issue
Block a user