# dcc.Interval update when not in focus

**URL:** <https://community.plotly.com/t/dcc-interval-update-when-not-in-focus/82903>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [March 8, 2024, 9:44pm UTC](https://community.plotly.com/t/dcc-interval-update-when-not-in-focus/82903 "2024-03-08T21:44:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [March 8, 2024, 9:58pm UTC](https://community.plotly.com/t/dcc-interval-update-when-not-in-focus/82903/2 "2024-03-08T21:58:16Z")

</div>

Hello @PyGuy,

You may be able to use something like this:

> [@New websocket component: DashSocketIO](https://community.plotly.com/t/new-websocket-component-dashsocketio/82774):
>
> Hello everyone wave I have just created a new dash component [dash-socketio](https://github.com/renaudln/dash_socketio), to go hand-in-hand with flask-socketio. It allows to do some pretty cool things with Dash like notifying the user of progress while a callback is running, or streaming outputs while a callback is still running. See below a GIF of usage.py in the repo. This is a toy example with the above 2 usecases implemented. [dash-socketio-usage] Hopefully this can be useful to some of the community!

Basically, on a db you keep track of the last callback executed by the user, could listen on the server using the flask.before\_request method to do that.

Then have a function that checks logged in users and their last activity time, if it is outside of the time frame, then you send a message and when the message is received it causes them to log out.

This might be easier to perform on something like a quartz server too, but a little more tricky to have the socket have the user info, since that info is in a different server.

---

_[View the full topic](https://community.plotly.com/t/dcc-interval-update-when-not-in-focus/82903)._
