示例#1
0
 def render_GET(self, request):
     request.setHeader(b"content-type", b"application/json")
     return (json.dumps({
         "status": "ok",
         "maxrss": get_ru_maxrss(),
     },
                        sort_keys=True)).encode('utf-8')
示例#2
0
文件: server.py 项目: Bzisch/splash
    def check_maxrss():
        if get_ru_maxrss() > maxrss * (1024 ** 2):
            log.msg("maxrss exceeded %d MB, shutting down..." % maxrss)

            # XXX: for some reason twisted qt5 reactor can stop without
            # finishing the Python process. This is a hack to exit anyways.
            def force_shutdown():
                log.msg("Reactor didn't stop cleanly, doing unclean shutdown.")
                os._exit(0)
            reactor.callLater(2.0, force_shutdown)

            reactor.stop()
示例#3
0
    def check_maxrss():
        if get_ru_maxrss() > maxrss * (1024 ** 2):
            log.msg("maxrss exceeded %d MB, shutting down..." % maxrss)

            # XXX: for some reason twisted qt5 reactor can stop without
            # finishing the Python process. This is a hack to exit anyways.
            def force_shutdown():
                log.msg("Reactor didn't stop cleanly, doing unclean shutdown.")
                os._exit(0)
            reactor.callLater(2.0, force_shutdown)

            reactor.stop()
示例#4
0
 def check_maxrss():
     if get_ru_maxrss() > maxrss * (1024**2):
         log.msg("maxrss exceeded %d MB, shutting down..." % maxrss)
         reactor.stop()
示例#5
0
 def render_GET(self, request):
     request.setHeader(b"content-type", b"application/json")
     return (json.dumps({
         "status": "ok",
         "maxrss": get_ru_maxrss(),
     }, sort_keys=True)).encode('utf-8')
示例#6
0
文件: server.py 项目: dwdm/splash
 def check_maxrss():
     if get_ru_maxrss() > maxrss * (1024 ** 2):
         log.msg("maxrss exceeded %d MB, shutting down..." % maxrss)
         reactor.stop()