bugfix
This commit is contained in:
parent
305da25420
commit
ae2a7be09d
@ -87,7 +87,10 @@ def get_idle(user):
|
|||||||
for user in psutil.users():
|
for user in psutil.users():
|
||||||
if user.name in exclude_users:
|
if user.name in exclude_users:
|
||||||
continue
|
continue
|
||||||
login_pid = user.pid
|
try:
|
||||||
|
login_pid = user.pid
|
||||||
|
except AttributeError:
|
||||||
|
continue # Doesn't have a PID
|
||||||
login_length = (datetime.datetime.utcnow() - datetime.datetime.fromtimestamp(user.started))
|
login_length = (datetime.datetime.utcnow() - datetime.datetime.fromtimestamp(user.started))
|
||||||
if login_length.total_seconds() < timeout:
|
if login_length.total_seconds() < timeout:
|
||||||
continue # they haven't even been logged in for long enough yet.
|
continue # they haven't even been logged in for long enough yet.
|
||||||
|
Loading…
Reference in New Issue
Block a user