(self, _fairy_was_created: bool = True)
| 747 | ) |
| 748 | |
| 749 | def checkin(self, _fairy_was_created: bool = True) -> None: |
| 750 | if self.fairy_ref is None and _fairy_was_created: |
| 751 | # _fairy_was_created is False for the initial get connection phase; |
| 752 | # meaning there was no _ConnectionFairy and we must unconditionally |
| 753 | # do a checkin. |
| 754 | # |
| 755 | # otherwise, if fairy_was_created==True, if fairy_ref is None here |
| 756 | # that means we were checked in already, so this looks like |
| 757 | # a double checkin. |
| 758 | util.warn("Double checkin attempted on %s" % self) |
| 759 | return |
| 760 | self.fairy_ref = None |
| 761 | connection = self.dbapi_connection |
| 762 | pool = self.__pool |
| 763 | while self.finalize_callback: |
| 764 | finalizer = self.finalize_callback.pop() |
| 765 | if connection is not None: |
| 766 | finalizer(connection) |
| 767 | if pool.dispatch.checkin: |
| 768 | pool.dispatch.checkin(connection, self) |
| 769 | |
| 770 | pool._return_conn(self) |
| 771 | |
| 772 | @property |
| 773 | def in_use(self) -> bool: |
no test coverage detected