jupyter-scheduler icon indicating copy to clipboard operation
jupyter-scheduler copied to clipboard

Add `_update_last_activity` to the extension app

Open mimikwang opened this issue 7 months ago • 1 comments

References

This addresses #563

Code changes

Added _update_last_activity to the extension app to update the last_activity_times look up in the web application. Pass this method down to the scheduler so that it can be used to update the last_activity whenever a job is created. May want to add it elsewhere in the future, but this is a good start.

I tested it by using docker

FROM quay.io/jupyter/minimal-notebook:latest

ENV JUPYTER_TOKEN=token

USER root
RUN apt update -y && apt install -y gcc npm

COPY . .

RUN pip install .

EXPOSE 8888

I scheduled a job that ran every minute and traveled to http://localhost:8888/api/status, which shows something like

{
  "connections": 0,
  "kernels": 0,
  "last_activity": "2025-04-13T19:04:50.087961Z",
  "started": "2025-04-13T19:04:40.605374Z"
}

Before the change, the last_activity would not update with when a job is run. After the change, it is updated whenever a job is run.

mimikwang avatar Apr 13 '25 19:04 mimikwang

hey @andrii-i - just wondering if you need anything from me for this!

mimikwang avatar Jun 11 '25 00:06 mimikwang