Skip to content

Commit

Permalink
Update listend.py
Browse files Browse the repository at this point in the history
fixed quick bug due to double header writes during rotations
  • Loading branch information
rtevans committed Apr 7, 2016
1 parent 8c2e4e9 commit 6e1b7b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tacc_stats/listend.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def on_message(channel, method_frame, header_frame, body):

with open(current_path, 'w') as fd:
link_path = os.path.join(host_dir, str(int(time.time())))
if not os.path.exists(link_path):
os.link(current_path, link_path)
if os.path.exists(link_path):
os.remove(link_path)
os.link(current_path, link_path)

with open(current_path, 'a') as fd:
fd.write(body)
Expand Down

0 comments on commit 6e1b7b6

Please sign in to comment.