Closed zieren closed 2 years ago
The background is a user report about the client "not working".
Essentially the client is already logging activity to the server all the time. As long as that is happening everything is OK, so we should focus on detecting if the client is ever NOT running.
One idea is to do this on script startup:
However, users may start the machine long before logging in, and vice versa when logging out and shutting down. So what we really want is user login/logout time, and that doesn't seem to be available in standalone machines.
Maybe it is actually easier to run a second script to monitor that the actual script is running? (example)
Also, this doesn't address the question of identifying the reason for the failure. We should probably enclose the main function in a try-catch block and also monitor time since the last successful request. Then log to a file (or to the server?) to capture any issue that either throws in the main loop or leaves the last successful request timestamp unupdated. Maybe use OnError()?
Errors should also be surfaced on the server, but that's no longer p0 for-0.0.1.
Continued in #72.
The client should log recent operations. (As long as the server is reachable it might even log remotely.)