lundi 5 octobre 2020

How can I tell if a user is active on a particular web page?

I have a web app that tracks different jobs that have different states. Each job can be:

  • New or unstarted.
  • Started and active
  • Started and transitioned (not active)
  • Finished

My issue is that sometimes a browser crashes or internet goes out or browsers get closed accidentally and a job gets stuck in the active state. I have it set up now where a manager or factory admin can update the state of a job manually, but this has become tedious. Is there a better solution to automatically determine when a user is not actively working on a job?

Note that while a job is active, javascript runs a timer and updates the server every 5 seconds to keep a job runtime. This job can also be paused but still active where the timer no longer runs.

I am not sure if there is a way to determine if the timer updates (or 'heartbeats') have stopped coming.




Aucun commentaire:

Enregistrer un commentaire