Skip to content

Commit

Permalink
create log file if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Jan 31, 2025
1 parent 5068f5c commit 64c7f43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transformerlab/routers/serverinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ def cleanup_at_exit():
async def watch_file(filename: str, start_from_beginning=False, force_polling=False) -> AsyncGenerator[str, None]:
print(f"👀 Watching file: {filename}")

# create the file if it doesn't already exist:
if not os.path.exists(filename):
with open(filename, "w") as f:
f.write("")

last_position = 0
if start_from_beginning:
last_position = 0
Expand Down

0 comments on commit 64c7f43

Please sign in to comment.