Get cached responses, with sorting and other query options. Args: key: Key to sort by; either 'expires', 'size', or 'key' reversed: Sort in descending order limit: Maximum number of responses to return expired: Set to ``False`` to exclude expi
(
self,
key: str = 'expires',
reversed: bool = False,
limit: Optional[int] = None,
expired: bool = True,
)
| 173 | super().recreate_keys() |
| 174 | |
| 175 | def sorted( |
| 176 | self, |
| 177 | key: str = 'expires', |
| 178 | reversed: bool = False, |
| 179 | limit: Optional[int] = None, |
| 180 | expired: bool = True, |
| 181 | ) -> Iterator[CachedResponse]: |
| 182 | """Get cached responses, with sorting and other query options. |
| 183 | |
| 184 | Args: |
| 185 | key: Key to sort by; either 'expires', 'size', or 'key' |
| 186 | reversed: Sort in descending order |
| 187 | limit: Maximum number of responses to return |
| 188 | expired: Set to ``False`` to exclude expired responses |
| 189 | """ |
| 190 | return self.responses.sorted(key, reversed, limit, expired) |
| 191 | |
| 192 | |
| 193 | class SQLiteDict(BaseStorage): |