Skip to content

Commit

Permalink
Fixes #130
Browse files Browse the repository at this point in the history
Ah, python type system...
  • Loading branch information
alq666 committed Aug 3, 2012
1 parent fda3013 commit c2a0648
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ddagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def post(self):
class Application(tornado.web.Application):

def __init__(self, port, agentConfig):
self._port = port
self._port = int(port)
self._agentConfig = agentConfig
self._metrics = {}
self._watchdog = Watchdog(TRANSACTION_FLUSH_INTERVAL * WATCHDOG_INTERVAL_MULTIPLIER)
Expand Down Expand Up @@ -227,7 +227,7 @@ def run(self):
tornado.web.Application.__init__(self, handlers, **settings)
http_server = tornado.httpserver.HTTPServer(self)
http_server.listen(self._port)
logging.info("Listening on port %s" % self._port)
logging.info("Listening on port %d" % self._port)

# Register callbacks
mloop = tornado.ioloop.IOLoop.instance()
Expand Down Expand Up @@ -263,13 +263,10 @@ def main():

agentConfig = get_config(parse_args = False)

port = agentConfig.get('listen_port', None)
if port is None:
port = 17123
port = int(agentConfig.get('listen_port', 17123))

app = Application(port, agentConfig)
app.run()

if __name__ == "__main__":
main()

0 comments on commit c2a0648

Please sign in to comment.