cpu tips 优化

gogs 统计优化
This commit is contained in:
midoks
2022-09-16 11:49:20 +08:00
parent 38f8fe9a38
commit b314ebeed3
5 changed files with 55 additions and 25 deletions
+1 -6
View File
@@ -681,12 +681,7 @@ def getTotalStatistics():
data = {}
if st.strip() == 'start':
list_count = pQuery('select count(id) as num from repository')
if list_count.find("error") > -1:
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
count = list_count[0]["num"]
data['status'] = True
data['count'] = count
data['ver'] = mw.readFile(getServerDir() + '/version.pl').strip()