fix: pool has already been opened/closed and cannot be reused
This commit is contained in:
@@ -20,7 +20,7 @@ async def main():
|
|||||||
await asyncio.sleep(60 * 30)
|
await asyncio.sleep(60 * 30)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
await asyncio.sleep(60*60)
|
await asyncio.sleep(60 * 60)
|
||||||
|
|
||||||
|
|
||||||
async def do_analyze():
|
async def do_analyze():
|
||||||
@@ -60,15 +60,12 @@ async def do_analyze():
|
|||||||
""",
|
""",
|
||||||
{
|
{
|
||||||
"es_id": doc_id,
|
"es_id": doc_id,
|
||||||
"risk_types": json.dumps(list(risks), ensure_ascii=False) if risks else None,
|
"risk_types": (
|
||||||
|
json.dumps(list(risks), ensure_ascii=False) if risks else None
|
||||||
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
await asyncio.gather(
|
|
||||||
pool.close(),
|
|
||||||
mysql.disconnect(),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class RiskType:
|
class RiskType:
|
||||||
|
|||||||
Reference in New Issue
Block a user