Skip to content
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

Global Timer abstractions #74

Open
agritheory opened this issue Apr 25, 2024 · 1 comment
Open

Global Timer abstractions #74

agritheory opened this issue Apr 25, 2024 · 1 comment

Comments

@agritheory
Copy link
Owner

Timer Abstraction

  • User (required)
  • Doctype
  • Docname
  • Description
  • Start time (required)
  • Reminder time

We should expect this to interface with Job Card, Employee Checkin, Timesheets (vanilla and T&E implementations) and Tasks.

@bhattdevarsh
Copy link
Collaborator

bhattdevarsh commented May 17, 2024

I have faced similar issue previously when a client wanted to display Job card list with timer that shows time taken for an item in a machine, The issue I faced may be relevant to this as well as other projects.

So, The device was a monitor hanging from the roof above each manufacturing machine showcasing timer. Each monitor was using some or the other user's login to show the timer. The issue was: the timer was running on the JS(or headless app), it was not shared between the sessions or devices, that means if the timer started for JC 1 for Machine 1 the other monitor would still show JC 1 in queue for Machine 2. This caused a little chaos on the floor on first release. The final solution to this was to make a async post request to server that store the current timestamp as start_time and we used that flied as flag to indicate JC is in process or not, if it exists we use that to calculate difference between Now and start_time and resume the timer from the difference on the JS(or headless app) that allowed us to have a share timer for each monitor. There can be a scenario where user may not want to store the start time in the database, in such case we can use frappe.cache.

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

No branches or pull requests

2 participants