Issue #245 resolved

stop method is never called when autoreloading

Anonymous created an issue

It looks like the stop() method is never called on the cherrypy.server object when sending a keyboard interrupt signal.

Therefore, lists such as onStopServerList are not used.

Reported by lawouach

Comments (13)

  1. Anonymous

    Actually there is no exception triggered and the server does not crash. I have just noticed the onStopServerList is only caled if you explictely call stop().

    I'll try to dig that later on

  2. Anonymous

    It seems to work on linux and OSX.

    just copy this to the top of any program

    def onStop():
        print 'this function should get called when the server starts'
  3. Anonymous

    Test under windows: '''fails'''

    console output is merely: 2005/08/21 18:45:59 HTTP INFO <Ctrl-C> hit: shutting down autoreloader

  4. Robert Brewer

    I'm going to assume the Ctrl-C issue was fixed in [698] and [699]. However, if you run CP with some other (non-built-in) HTTP server, it looks like the onStopServerList funcs aren't called. That needs to be fixed.

  5. Log in to comment