diff --git a/authentik/outposts/models.py b/authentik/outposts/models.py index 56077bba8..a301bb892 100644 --- a/authentik/outposts/models.py +++ b/authentik/outposts/models.py @@ -35,7 +35,6 @@ from authentik.lib.models import InheritanceForeignKey from authentik.lib.sentry import SentryIgnoredException from authentik.lib.utils.template import render_to_string from authentik.outposts.docker_tls import DockerInlineTLS -from authentik.outposts.tasks import outpost_service_connection_state OUR_VERSION = parse(__version__) OUTPOST_HELLO_INTERVAL = 10 @@ -122,6 +121,8 @@ class OutpostServiceConnection(models.Model): @property def state(self) -> OutpostServiceConnectionState: """Get state of service connection""" + from authentik.outposts.tasks import outpost_service_connection_state + state = cache.get(self.state_key, None) if not state: outpost_service_connection_state.delay(self.pk)