Skip to content

Commit 41d0fae

Browse files
authored
Merge pull request #52 from ausecocloud/master
record api_last_activity as timezone aware timestamp
2 parents 8aba2ca + 980600d commit 41d0fae

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nbserverproxy/handlers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Some original inspiration from https://github.com/senko/tornado-proxy
55
"""
66

7-
from datetime import datetime
87
import inspect
98
import socket
109
import os
@@ -13,7 +12,7 @@
1312
from tornado import gen, web, httpclient, httputil, process, websocket, ioloop, version_info
1413

1514
from notebook.utils import url_path_join
16-
from notebook.base.handlers import IPythonHandler
15+
from notebook.base.handlers import IPythonHandler, utcnow
1716

1817

1918
class AddSlashHandler(IPythonHandler):
@@ -194,7 +193,7 @@ def _record_activity(self):
194193
avoids proxied traffic being ignored by the notebook's
195194
internal idle-shutdown mechanism
196195
"""
197-
self.settings['api_last_activity'] = datetime.utcnow()
196+
self.settings['api_last_activity'] = utcnow()
198197

199198

200199
@web.authenticated

0 commit comments

Comments
 (0)