Skip to content

Add _update_last_activity to the extension app #582

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mimikwang
Copy link

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 and others added 3 commits April 13, 2025 12:06
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_acitivity` whenever a job is created. May want to add it elsewhere
in the future, but this is a good start.
@andrii-i andrii-i self-requested a review May 8, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant