mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 14:33:00 +00:00
notmybestwork: avoid updating user activity with server api access
this isn't the most important metric (server.last_activity is), but avoid *probable* server api access incrementing user.last_activity
This commit is contained in:
@@ -310,7 +310,11 @@ class BaseHandler(RequestHandler):
|
||||
now = datetime.utcnow()
|
||||
orm_token.last_activity = now
|
||||
if orm_token.user:
|
||||
orm_token.user.last_activity = now
|
||||
# FIXME: scopes should give us better control than this
|
||||
# don't consider API requests originating from a server
|
||||
# to be activity from the user
|
||||
if not orm_token.note.startswith("Server at "):
|
||||
orm_token.user.last_activity = now
|
||||
self.db.commit()
|
||||
|
||||
if orm_token.service:
|
||||
|
Reference in New Issue
Block a user