mirror of
https://github.com/goauthentik/authentik
synced 2026-04-27 09:57:31 +02:00
* start db cache Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update codeowners Signed-off-by: Jens Langhammer <jens@goauthentik.io> * handle db error in keys Signed-off-by: Jens Langhammer <jens@goauthentik.io> * implement rest of the methods Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix unrelated warning on startup for cache Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix migrations? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add readme Signed-off-by: Jens Langhammer <jens@goauthentik.io> * dynamic dependency...? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * types Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rip out django_redis Signed-off-by: Jens Langhammer <jens@goauthentik.io> * format Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix get default Signed-off-by: Jens Langhammer <jens@goauthentik.io> * some cleanup Signed-off-by: Jens Langhammer <jens@goauthentik.io> * simplify to use ORM Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove old migrations that use cache instead of doing dynamic things Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix migration Signed-off-by: Jens Langhammer <jens@goauthentik.io> * Update packages/django-postgres-cache/django_postgres_cache/models.py Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * Update packages/django-postgres-cache/django_postgres_cache/migrations/0001_initial.py Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * fix redis imports Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * more redis removal Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * lint Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
12 lines
392 B
Python
12 lines
392 B
Python
from django.utils.timezone import now
|
|
|
|
from authentik.lib.utils.db import chunked_queryset
|
|
from django_postgres_cache.models import CacheEntry
|
|
|
|
|
|
def clear_expired_cache() -> None:
|
|
# FIXME: this is currently imported from the main project,
|
|
# do we copy it here to make it independent?
|
|
for obj in chunked_queryset(CacheEntry.objects.filter(expires__lt=now())):
|
|
obj.delete()
|