File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,20 @@ async def before_server_start(_, loop):
105
105
enable_inherit (loop )
106
106
inherit_enabled [0 ] = True
107
107
108
- await self .set_bind (
109
- URL (
108
+ if app .config .get ('DB_DSN' ):
109
+ dsn = app .config .DB_DSN
110
+ else :
111
+ dsn = URL (
110
112
drivername = app .config .setdefault ('DB_DRIVER' , 'asyncpg' ),
111
113
host = app .config .setdefault ('DB_HOST' , 'localhost' ),
112
114
port = app .config .setdefault ('DB_PORT' , 5432 ),
113
115
username = app .config .setdefault ('DB_USER' , 'postgres' ),
114
116
password = app .config .setdefault ('DB_PASSWORD' , '' ),
115
117
database = app .config .setdefault ('DB_DATABASE' , 'postgres' ),
116
- ),
118
+ )
119
+
120
+ await self .set_bind (
121
+ dsn ,
117
122
min_size = app .config .setdefault ('DB_POOL_MIN_SIZE' , 5 ),
118
123
max_size = app .config .setdefault ('DB_POOL_MAX_SIZE' , 10 ),
119
124
loop = loop ,
You can’t perform that action at this time.
0 commit comments