mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-01 23:30:24 +00:00
fix(examples): update client usage to prefer await aclose() in async context" (#2839)
This commit is contained in:
@@ -83,8 +83,12 @@ async def main():
|
||||
}
|
||||
],
|
||||
)
|
||||
data = await run_evaluation(client, request=request)
|
||||
print(data)
|
||||
try:
|
||||
data = await run_evaluation(client, request=request)
|
||||
print(data)
|
||||
finally:
|
||||
# explicitly close client to avoid event loop closed error
|
||||
await client.aclose()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user