Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Port from 2.7 branch.
Browse files Browse the repository at this point in the history
Shut down cleanly when Windows is shutting down.
  • Loading branch information
Tim Peters committed Jun 20, 2005
1 parent 2efc98e commit 31f4f28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ def SvcStop(self):
# Set the stop event - the main loop takes care of termination.
win32event.SetEvent(self.hWaitStop)

# SvcStop only gets triggered when the user explictly stops (or restarts)
# the service. To shut the service down cleanly when Windows is shutting
# down, we also need to hook SvcShutdown.
SvcShutdown = SvcStop

def onStop(self):
# A hook for subclasses to override
pass
Expand Down

0 comments on commit 31f4f28

Please sign in to comment.