Skip to content

Commit

Permalink
fix: postgresql AsyncConnection add await close
Browse files Browse the repository at this point in the history
  • Loading branch information
shengchenyang committed Dec 21, 2023
1 parent 35255e2 commit f7b6511
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ayugespidertools/scraper/pipelines/postgres/asynced.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@ async def process_item(self, item, spider):
task.add_done_callback(lambda t: self.running_tasks.discard(t))
return item

async def _close_spider(self):
await self.conn.close()

def close_spider(self, spider):
self.conn.close()
return deferred_from_coro(self._close_spider())

0 comments on commit f7b6511

Please sign in to comment.