-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.py
More file actions
executable file
·36 lines (27 loc) · 939 Bytes
/
start.py
File metadata and controls
executable file
·36 lines (27 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
""""Server entry point."""
import logging
import sys
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import define, options
from wdcnz import application
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
log = logging.getLogger(__name__)
define("port", default=8888, help="run on the given port", type=int)
define("cassandra_host", default="localhost:9160",
help="Cassandra host and port.")
define("cassandra_keyspace", default="wdcnz", help="Cassandra Keyspace")
def main():
log.info("Starting...")
tornado.options.parse_command_line()
http_server = tornado.httpserver.HTTPServer(
application.WdcnzApplication())
http_server.listen(options.port)
log.info("Staring IO Loop")
tornado.ioloop.IOLoop.instance().start()
log.info("IO Loop stopped")
return
if __name__ == "__main__":
main()