Skip to content

Commit

Permalink
ref: remove incr_version / decr_version (#15)
Browse files Browse the repository at this point in the history
these methods are unsafe with our usage of cache
  • Loading branch information
asottile-sentry committed Jul 31, 2024
1 parent 36b0132 commit 4a1b05c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions django-stubs/core/cache/backends/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class BaseCache:
async def adelete_many(self, keys: Iterable[Any], version: Any | None = ...) -> None: ...
def clear(self) -> None: ...
async def aclear(self) -> None: ...
def incr_version(self, key: Any, delta: int = ..., version: Any | None = ...) -> int: ...
async def aincr_version(self, key: Any, delta: int = ..., version: Any | None = ...) -> int: ...
def decr_version(self, key: Any, delta: int = ..., version: Any | None = ...) -> int: ...
async def adecr_version(self, key: Any, delta: int = ..., version: Any | None = ...) -> int: ...
def close(self, **kwargs: Any) -> None: ...
async def aclose(self, **kwargs: Any) -> None: ...

Expand Down
10 changes: 10 additions & 0 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,13 @@ django.contrib.gis.db.models.ManyToManyField.m2m_target_field_name

# Defined inside a signature (using the walrus operator)
django.core.management.utils.sentinel

# sentry: we remove these methods because they are unsafe for our usage
django.core.cache.BaseCache.adecr_version
django.core.cache.BaseCache.aincr_version
django.core.cache.BaseCache.decr_version
django.core.cache.BaseCache.incr_version
django.core.cache.backends.base.BaseCache.adecr_version
django.core.cache.backends.base.BaseCache.aincr_version
django.core.cache.backends.base.BaseCache.decr_version
django.core.cache.backends.base.BaseCache.incr_version

0 comments on commit 4a1b05c

Please sign in to comment.