fix: 修复windows系统下初始化表结构编码问题

This commit is contained in:
Relakkes 2024-08-07 01:02:35 +08:00
parent 85727da1d3
commit 7e9a759d94
1 changed files with 1 additions and 1 deletions

2
db.py
View File

@ -85,7 +85,7 @@ async def init_table_schema():
utils.logger.info("[init_table_schema] begin init mysql table schema ...") utils.logger.info("[init_table_schema] begin init mysql table schema ...")
await init_mediacrawler_db() await init_mediacrawler_db()
async_db_obj: AsyncMysqlDB = media_crawler_db_var.get() async_db_obj: AsyncMysqlDB = media_crawler_db_var.get()
async with aiofiles.open("schema/tables.sql", mode="r") as f: async with aiofiles.open("schema/tables.sql", mode="r", encoding="utf-8") as f:
schema_sql = await f.read() schema_sql = await f.read()
await async_db_obj.execute(schema_sql) await async_db_obj.execute(schema_sql)
utils.logger.info("[init_table_schema] mediacrawler table schema init successful") utils.logger.info("[init_table_schema] mediacrawler table schema init successful")