Skip to content

Commit

Permalink
try no process info on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
orm011 committed May 17, 2024
1 parent 0aa3662 commit 605855b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pgserver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ def _init_process_meta(self) -> Optional[psutil.Process]:
except psutil.NoSuchProcess:
return

if self.start_time is None:
return

exact_create_time = datetime.datetime.fromtimestamp(process.create_time())
if abs(self.start_time - exact_create_time) <= datetime.timedelta(seconds=1):
self.process = process
self.process = process
# exact_create_time = datetime.datetime.fromtimestamp(process.create_time())
# if abs(self.start_time - exact_create_time) <= datetime.timedelta(seconds=1):

def is_running(self) -> bool:
return self.process is not None and self.process.is_running()
Expand Down

0 comments on commit 605855b

Please sign in to comment.