(self)
| 1720 | return True |
| 1721 | |
| 1722 | def reset(self) -> None: |
| 1723 | self.command_stack = [] |
| 1724 | self.scripts = set() |
| 1725 | # make sure to reset the connection state in the event that we were |
| 1726 | # watching something |
| 1727 | if self.watching and self.connection: |
| 1728 | try: |
| 1729 | # call this manually since our unwatch or |
| 1730 | # immediate_execute_command methods can call reset() |
| 1731 | self.connection.send_command("UNWATCH") |
| 1732 | self.connection.read_response() |
| 1733 | except ConnectionError: |
| 1734 | # disconnect will also remove any previous WATCHes |
| 1735 | self.connection.disconnect() |
| 1736 | # clean up the other instance attributes |
| 1737 | self.watching = False |
| 1738 | self.explicit_transaction = False |
| 1739 | |
| 1740 | # we can safely return the connection to the pool here since we're |
| 1741 | # sure we're no longer WATCHing anything |
| 1742 | if self.connection: |
| 1743 | self.connection_pool.release(self.connection) |
| 1744 | self.connection = None |
| 1745 | |
| 1746 | def close(self) -> None: |
| 1747 | """Close the pipeline""" |
no test coverage detected