Пример #1
0
    def run():

        app.run(port=SERVER_PORT)
Пример #2
0
    SERVER_PORT = 5000

# Configure logging
logging.basicConfig(filename=LOG_FILE, level=logging.DEBUG)


class MarlinServer():

    def __init__(self, pidfile='/tmp/', stderr='/dev/null', stdout='/dev/null'):
        self.stdin_path = '/dev/null'
        self.stdout_path = stdout
        self.stderr_path = stderr
        self.pidfile_path = pidfile
        self.pidfile_timeout = 5

    @staticmethod
    def run():

        app.run(port=SERVER_PORT)


if __name__ == "__main__":
    marlin_server = MarlinServer(pidfile=PID_FILE)
    if len(sys.argv) == 2 and 'live' == sys.argv[1]:
        print "Starting Test Server ..."
        app.debug = True
        app.run(port=SERVER_PORT)
        sys.exit(0)
    runner = runner.DaemonRunner(marlin_server)
    runner.do_action()