Subversion Repositories SmartDukaan

Rev

Rev 3915 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3915 Rev 4651
Line 24... Line 24...
24
    
24
    
25
    def __init__(self, logfile='/var/log/services/order.log', pidfile='/tmp/transaction-server.pid'):
25
    def __init__(self, logfile='/var/log/services/order.log', pidfile='/tmp/transaction-server.pid'):
26
        Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
26
        Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
27
        
27
        
28
    def run(self):
28
    def run(self):
29
        try:
29
    
30
            config_client = ConfigClient()
30
        config_client = ConfigClient()
31
            host_name = config_client.get_property('transaction_service_server_host')
31
        host_name = config_client.get_property('transaction_service_server_host')
32
            port = config_client.get_property('transaction_service_server_port')
32
        port = config_client.get_property('transaction_service_server_port')
33
            dbname = config_client.get_property('transaction_service_dbname')
33
        dbname = config_client.get_property('transaction_service_dbname')
34
            db_hostname = config_client.get_property('transaction_service_db_hostname')
34
        db_hostname = config_client.get_property('transaction_service_db_hostname')
35
        except:
-
 
36
            #error while spawning the config server
-
 
37
            host_name = 'localhost'
-
 
38
            port = 9002
-
 
39
            dbname = 'transaction'
-
 
40
            db_hostname='localhost'
-
 
41
            
35
            
42
        handler = OrderServiceHandler(dbname, db_hostname)
36
        handler = OrderServiceHandler(dbname, db_hostname)
43
        processor = TransactionService.Processor(handler)
37
        processor = TransactionService.Processor(handler)
44
        transport = TSocket.TServerSocket(port=port)
38
        transport = TSocket.TServerSocket(port=port)
45
        tfactory = TTransport.TFramedTransportFactory()
39
        tfactory = TTransport.TFramedTransportFactory()