fix: use offset-naive datetime for last_activity to match JupyterHub internal format

This commit is contained in:
stellarshenson
2026-01-18 21:01:28 +01:00
parent 1d5fb93c49
commit de3863ef5e
3 changed files with 7 additions and 3 deletions

View File

@@ -174,3 +174,6 @@ This journal tracks substantive work on documents, diagrams, and documentation c
57. **Task - Harmonize env settings across files**: Ensured all env settings are consistent in compose.yml, Dockerfile, and config<br>
**Result**: Added all missing ENV defaults to Dockerfile (ADMIN, BASE_URL, SSL_ENABLED, NOTEBOOK_IMAGE, NETWORK_NAME, GPU_ENABLED, NVIDIA_IMAGE, SERVICE_MLFLOW/RESOURCES_MONITOR/TENSORBOARD, all IDLE_CULLER settings, TF_CPP_MIN_LOG_LEVEL), added AUTOGENERATED_PASSWORD_WORDS/DELIMITER to compose.yml, standardized logo setting as JUPYTERHUB_LOGO_URI with file:// prefix (supports external http/https URIs), updated NVIDIA_IMAGE to nvidia/cuda:13.0.2-base-ubuntu24.04 across all files (compose.yml, jupyterhub_config.py, Dockerfile, settings_dictionary.yml, README.md, CLAUDE.md), config now strips file:// prefix for local files while allowing external URI support in templates
58. **Task - Improve session extension UI**: Changed extension input from dropdown to numeric and added explanatory note<br>
**Result**: Replaced dropdown with numeric input (min=1, max set dynamically to available hours), renamed card title to "Idle Session Timeout", added explanatory note "Your server will be stopped after a period of inactivity to free up resources", added input validation for minimum 1 hour, button text shortened to "Extend"

View File

@@ -3,7 +3,7 @@ PROJECT_NAME="stellars-jupyterhub-ds"
PROJECT_DESCRIPTION="Multi-user JupyterHub 4 deployment platform with data science stack, GPU auto-detection, NativeAuthenticator, and isolated per-user environments spawned via DockerSpawner"
# Version
VERSION="3.6.15_cuda-13.0.2_jh-5.4.2"
VERSION="3.6.16_cuda-13.0.2_jh-5.4.2"
VERSION_COMMENT="Standardize env vars with JUPYTERHUB_ prefix, admin settings page"
RELEASE_TAG="RELEASE_3.2.11"
RELEASE_DATE="2025-11-09"

View File

@@ -720,8 +720,9 @@ class ExtendSessionHandler(BaseHandler):
})
# Update last_activity to reset the idle timer
from datetime import datetime, timezone
now = datetime.now(timezone.utc)
# Use utcnow() without timezone info to match JupyterHub's internal format
from datetime import datetime
now = datetime.utcnow()
user.last_activity = now
self.db.commit()