Skip to content

record api_last_activity as timezone aware timestamp #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions nbserverproxy/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Some original inspiration from https://github.com/senko/tornado-proxy
"""

from datetime import datetime
import inspect
import socket
import os
Expand All @@ -13,7 +12,7 @@
from tornado import gen, web, httpclient, httputil, process, websocket, ioloop, version_info

from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler
from notebook.base.handlers import IPythonHandler, utcnow


class AddSlashHandler(IPythonHandler):
Expand Down Expand Up @@ -194,7 +193,7 @@ def _record_activity(self):
avoids proxied traffic being ignored by the notebook's
internal idle-shutdown mechanism
"""
self.settings['api_last_activity'] = datetime.utcnow()
self.settings['api_last_activity'] = utcnow()


@web.authenticated
Expand Down