You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have written a windows service that periodically processes a lot data. Because of how it works and what it does, when a stop gets requested it needs to finish processing, and only then it can stop.
Currently if i request the service to stop while it is processing the data the windows will throw an error sayig that the service did not stop in timely manner.
In c# one can call RequestAdditionalTime() function, to keep the windows happy while the service is stopping. Can this be somehow be achieved in cx_freeze generated windows services?
This could also be useful when starting a service that takes a long time for initialization.
The text was updated successfully, but these errors were encountered:
In c# one can call RequestAdditionalTime() function, to keep the windows happy while the service is stopping. Can this be somehow be achieved in cx_freeze generated windows services?
We can implement this. Can you do it (if you use C) or at least find the equivalent function in C so I can implement it?
But i guess the equivalent functionality could be achieved by calling SetServiceStatus with value of SERVICE_STOP_PENDING repedately.
I have since implemented my service using the win32service library, and doing this works:
whilehas_running_tasks():
logger.info("Waiting for still running tasks to finish")
time.sleep(5)
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
The windows still will report that the service "did not stop in a timely manner" (but will take more time than normally), and will not kill it forcefully, allowing the service to stop properely (i had one taks that took additional 30 minutes to complete after asking windows to stop the service and the task finished normally and then the service did stop).
Hi
I have written a windows service that periodically processes a lot data. Because of how it works and what it does, when a stop gets requested it needs to finish processing, and only then it can stop.
Currently if i request the service to stop while it is processing the data the windows will throw an error sayig that the service did not stop in timely manner.
In c# one can call RequestAdditionalTime() function, to keep the windows happy while the service is stopping. Can this be somehow be achieved in cx_freeze generated windows services?
This could also be useful when starting a service that takes a long time for initialization.
The text was updated successfully, but these errors were encountered: