Skip to content

Commit f45739d

Browse files
committed
fix: 修复统计问题
1 parent feb1933 commit f45739d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ async def _(
2828
data = await random.choice(self.storages).express(
2929
file_hash, request, response
3030
)
31-
self.counters.bytes += int(data["bytes"])
32-
self.counters.hits += int(data["hits"])
31+
self.counters.bytes += data["bytes"]
32+
self.counters.hits += data["hits"]
3333
return response
3434

3535
@self.route.get("/measure/{size}")

core/storages/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def express(
8686
response.set_status(404, "File not found")
8787
return {"bytes": 0, "hits": 0}
8888
try:
89-
file_size = (os.path.getsize(path),)
89+
file_size = os.path.getsize(path)
9090
response = web.FileResponse(path, status=200)
9191
response.headers["x-bmclapi-hash"] = hash
9292
await response.prepare(request)

0 commit comments

Comments
 (0)