Delete all items from the cache. If this fails due to a corrupted cache or other I/O error, this will attempt to delete the cache file and re-initialize.
(self)
| 72 | return self.responses.db_path |
| 73 | |
| 74 | def clear(self): |
| 75 | """Delete all items from the cache. If this fails due to a corrupted cache or other I/O |
| 76 | error, this will attempt to delete the cache file and re-initialize. |
| 77 | """ |
| 78 | try: |
| 79 | super().clear() |
| 80 | except Exception: |
| 81 | logger.exception('Failed to clear cache') |
| 82 | if isfile(self.responses.db_path): |
| 83 | unlink(self.responses.db_path) |
| 84 | self.responses.init_db() |
| 85 | self.redirects.init_db() |
| 86 | |
| 87 | # A more efficient SQLite implementation of BaseCache.delete |
| 88 | def delete( |