pyaltt2/db.py
def connect(self):
        """
        Get thread-safe db connection
        """
        with self.db_lock:
            try:
                self.g.conn.execute('select 1')
                return self.g.conn
            except:
                self.g.conn = self.db.connect()
                return self.g.conn

        Get thread-safe db connection
        
Get thread-safe db connection
Get thread - safe db connection
def connect(self):
        with self.db_lock:
            try:
                self.g.conn.execute('select 1')
                return self.g.conn
            except:
                self.g.conn = self.db.connect()
                return self.g.conn
def connect ( self ) : with self . db_lock : try : self . g . conn . execute ( 'select 1' ) return self . g . conn except : self . g . conn = self . db . connect ( ) return self . g . conn
Get thread-safe db connection
Get thread - safe db connection
"""
        Get thread-safe db connection
        """
self