Is there a way to run a script on a client when an update is requested? Specifically I need to run it before the update takes place.
I’ve got a logging script on the client which writes certain values to a file on the client computer. This works fine and the log files roll over as expected at first.
The problem is that when I update the project it never closes the file handle on the original one and opens a new one. This is effectively seamless - we’re not writing to the old file handle anymore but are writing to the new one so logging still works. Until I go to roll over the file to a new one which involves os.rename() (pylib/logging/handlers.py line 346).
Normally this is OK since it closes the file stream before it does the rename. But since the old version is still open from the update it doesn’t work.
So I need some kind of cleanup logic to run when the project is updated on the client that makes sure the file handle is closed before starting again.
P.S. We’re using 8.1.0