Subversion Repositories SmartDukaan

Rev

Rev 1267 | Rev 3187 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1267 Rev 1277
Line 10... Line 10...
10
from thrift.server import TServer
10
from thrift.server import TServer
11
from shop2020.config.client.ConfigClient import ConfigClient
11
from shop2020.config.client.ConfigClient import ConfigClient
12
 
12
 
13
host_name = 'localhost'
13
host_name = 'localhost'
14
port = 9002
14
port = 9002
15
dbname = 'transaction' 
15
dbname = 'transaction'
16
 
16
 
17
def main():
17
def main():
18
    try:
18
    try:
19
        config_client = ConfigClient()
19
        config_client = ConfigClient()
20
        host_name = config_client.get_property('transaction_service_server_host')
20
        host_name = config_client.get_property('transaction_service_server_host')
Line 22... Line 22...
22
        dbname = config_client.get_property('transaction_service_dbname')
22
        dbname = config_client.get_property('transaction_service_dbname')
23
    except:
23
    except:
24
        #error while spawning the config server
24
        #error while spawning the config server
25
        host_name = 'localhost'
25
        host_name = 'localhost'
26
        port = 9002
26
        port = 9002
-
 
27
        dbname = 'transaction'
27
        
28
        
28
    handler = OrderServiceHandler(dbname)
29
    handler = OrderServiceHandler(dbname)
29
    processor = TransactionService.Processor(handler)
30
    processor = TransactionService.Processor(handler)
30
    transport = TSocket.TServerSocket(port)
31
    transport = TSocket.TServerSocket(port)
31
    tfactory = TTransport.TFramedTransportFactory()
32
    tfactory = TTransport.TFramedTransportFactory()