Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 5, 2023
1 parent 5dcfdf2 commit 2ea7587
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions robyn/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ def __init__(self, file_path: str) -> None:
self.file_path = file_path
self.process = None # Keep track of the subprocess

self.last_reload = time.time() # Keep track of the last reload. EventHandler is initialized with the process.
self.last_reload = (
time.time()
) # Keep track of the last reload. EventHandler is initialized with the process.

def stop_server(self):
if self.process:
os.kill(self.process.pid, signal.SIGTERM) # Stop the subprocess using os.kill()
os.kill(
self.process.pid, signal.SIGTERM
) # Stop the subprocess using os.kill()

def reload(self):
self.stop_server()
Expand Down Expand Up @@ -81,4 +85,3 @@ def on_modified(self, event) -> None:

time.sleep(0.2) # Wait for the file to be fully written
self.reload()

0 comments on commit 2ea7587

Please sign in to comment.