Set a value in the cache. If timeout is given, use that timeout for the key; otherwise use the default cache timeout.
(self, key, value, timeout=DEFAULT_TIMEOUT, version=None)
| 154 | ) |
| 155 | |
| 156 | def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): |
| 157 | """ |
| 158 | Set a value in the cache. If timeout is given, use that timeout for the |
| 159 | key; otherwise use the default cache timeout. |
| 160 | """ |
| 161 | raise NotImplementedError("subclasses of BaseCache must provide a set() method") |
| 162 | |
| 163 | async def aset(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): |
| 164 | return await sync_to_async(self.set, thread_sensitive=True)( |
no outgoing calls