fix: the date is incorrect if the db field is timestamp and the TZ is not the UTC (#4624)

Co-authored-by: liuzhenghua-jk <liuzhenghua-jk@360shuke.com>
This commit is contained in:
liuzhenghua 2024-05-25 13:11:18 +08:00 committed by GitHub
parent 5bd432a85f
commit ad620f02c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,7 +179,8 @@ class Config:
'pool_size': int(get_env('SQLALCHEMY_POOL_SIZE')),
'max_overflow': int(get_env('SQLALCHEMY_MAX_OVERFLOW')),
'pool_recycle': int(get_env('SQLALCHEMY_POOL_RECYCLE')),
'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING')
'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING'),
'connect_args': {'options': '-c timezone=UTC'},
}
self.SQLALCHEMY_ECHO = get_bool_env('SQLALCHEMY_ECHO')