Skip to content

Commit

Permalink
Change placement of flush() call
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Solomennikov <[email protected]>
  • Loading branch information
dmitrys99 committed Dec 23, 2024
1 parent cda423e commit 18ad0d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psrecord/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ def monitor(
if include_io:
f.write(f",{read_count},{write_count},{read_bytes},{write_bytes}")
f.write("\n")
f.flush()

if interval is not None:
time.sleep(interval)
Expand All @@ -296,6 +295,7 @@ def monitor(

# close the logfile, if it's not stdout
if logfile and logfile != "<stdout>":
f.flush()
f.close()

if plot:
Expand Down

0 comments on commit 18ad0d6

Please sign in to comment.