Skip to content

Commit

Permalink
not the client responsibility to give index number
Browse files Browse the repository at this point in the history
  • Loading branch information
elazarg committed Aug 4, 2024
1 parent df53560 commit 5700375
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions save_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ async def relay_qmp_dumps(qmp_port: int, server: Server) -> None:
await vm.dump(f"{folder}/0.a.dump")
with ThreadPoolExecutor() as executor:
ps: list[Future[int]] = []
for index in server:
for i, index in enumerate(server):
async with vm.pause(server.sleep_duration_ms):
current_next_file = f"{folder}/{index}.b.dump"
next_prev_file = f"{folder}/{index + 1}.a.dump"
current_next_file = f"{folder}/{i}.b.dump"
next_prev_file = f"{folder}/{i + 1}.a.dump"
await vm.dump(current_next_file)
os.link(current_next_file, next_prev_file)
p: Future[int] = executor.submit(count_diff, folder, index)
p: Future[int] = executor.submit(count_diff, folder, i)
if p is not None:
ps.append(p)
else:
Expand Down

0 comments on commit 5700375

Please sign in to comment.