@@ -17,17 +17,15 @@ class SessionFactory():
1717 def __init__ (self , connection_string , echo = True , version = 2.0 ):
1818
1919 if 'sqlite' in connection_string :
20- self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 1000 )
20+ self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 100 ) #, pool_pre_ping=True )
2121 self .test_engine = self .engine
2222 elif 'mssql' in connection_string :
23- self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 1000 )
24- self .test_engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 1000 ,
25- connect_args = {'timeout' : 1 })
23+ self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 100 )#, pool_pre_ping =True)
24+ self .test_engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , connect_args = {'timeout' : 1 })
2625 elif 'postgresql' in connection_string or 'mysql' in connection_string :
27- self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 1000 ,
28- pool_timeout = 1000 , pool_size = 20 , max_overflow = 0 )
29- self .test_engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 1000 ,
30- pool_timeout = 5 , max_overflow = 0 , connect_args = {'connect_timeout' : 1 })
26+ self .engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo , pool_recycle = 100 )# , pool_pre_ping=True)
27+ self .test_engine = create_engine (connection_string , encoding = 'utf-8' , echo = echo ,
28+ max_overflow = 0 , connect_args = {'connect_timeout' : 1 })
3129
3230 # Create session maker
3331 self .Session = scoped_session (sessionmaker (bind = self .engine , autoflush = True ))
0 commit comments