Skip to content

Commit bf14399

Browse files
committed
fix: 修复统计和代理 web 时候等待代理服务关闭时间过长
1 parent d4a4d84 commit bf14399

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.2
1+
3.0.3

core/cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,8 @@ async def _(request: aweb.Request):
11271127
type = db.StatusType.NOT_FOUND
11281128
elif resp.status == 302:
11291129
type = db.StatusType.REDIRECT
1130+
storage_name = file.storage.unique_id if file.storage is not None else None
1131+
db.add_file(cluster.id, storage_name, size)
11301132
db.add_response(
11311133
address,
11321134
type

core/dashboard.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ async def _(request: web.Request):
137137
db.ClusterStatisticsTable.hour >= hour_of_day,
138138
db.ClusterStatisticsTable.hour < next_hour
139139
).all()
140-
print(hour_of_day, next_hour)
141140
return web.json_response({
142141
"hits": sum([int(item.hits) for item in q]),
143142
"bytes": sum([int(item.bytes) for item in q])

core/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ async def _check_server(ip: str, port: int):
234234
try:
235235
r, w = await asyncio.wait_for(asyncio.open_connection(ip, port), 5)
236236
w.close()
237-
await w.wait_closed()
237+
await asyncio.wait_for(w.wait_closed(), 10)
238238
return True
239239
except:
240240
logger.ttraceback("web.traceback.check_server", port=port)

0 commit comments

Comments
 (0)