fix(async): synchronous only operation from update

This commit is contained in:
catvayor 2025-05-29 11:38:09 +02:00
parent 342ab6f141
commit 6fa7b88b5d
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -1,4 +1,5 @@
import djconfig
from asgiref.sync import sync_to_async
from django.core.exceptions import ValidationError
from django.db import models
@ -23,7 +24,7 @@ class KFetConfig(object):
# Note it should be called only once across requests, if you use
# kfet_config instance below.
if not self._conf_init:
djconfig.reload_maybe()
sync_to_async(djconfig.reload_maybe)()
self._conf_init = True
def __getattr__(self, key):