Skip to content

Commit

Permalink
fix: ios hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
1ukastesar authored and solumath committed Apr 18, 2024
1 parent 810098b commit ae670a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cogs/ios/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
from features.list_message_sender import send_list_of_messages


def running_for(time: str) -> int:
def running_for(time: str, time_dom: str) -> int:
now = datetime.datetime.now()
time_list = time.split(":")
if len(time_list) == 2:
hours = now.hour - int(time_list[0])
minutes = now.minute - int(time_list[1])
return hours * 60 + minutes
else:
if time_dom:
time_list[0] = "".join([time, time_dom])
try:
date = datetime.datetime.strptime(time_list[0], "%b%d")
except ValueError:
Expand Down Expand Up @@ -116,7 +118,8 @@ def parse_processes(processes: str) -> dict:
if not login.startswith("x"):
continue
time = line_split[8]
uptime = running_for(time)
time_dom = line_split[9]
uptime = running_for(time, time_dom)
if uptime > 10:
if login not in parsed:
parsed[login] = list()
Expand Down

0 comments on commit ae670a3

Please sign in to comment.