AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(platform): Stop the start up & shutdown of LaunchDarkly on local envs (#8897)
Aarushiea6c9a115278
diff --git a/autogpt_platform/backend/backend/server/rest_api.py b/autogpt_platform/backend/backend/server/rest_api.pyindex d0ba73f65a..0efe68862d 100644--- a/autogpt_platform/backend/backend/server/rest_api.py+++ b/autogpt_platform/backend/backend/server/rest_api.py@@ -25,15 +25,26 @@ logger = logging.getLogger(__name__)logging.getLogger("autogpt_libs").setLevel(logging.INFO)+def launch_darkly_context():+ if settings.config.app_env != backend.util.settings.AppEnvironment.LOCAL:+ initialize_launchdarkly()+ try:+ yield+ finally:+ shutdown_launchdarkly()+ else:+ yield++@contextlib.asynccontextmanagerasync def lifespan_context(app: fastapi.FastAPI):await backend.data.db.connect()await backend.data.block.initialize_blocks()await backend.data.user.migrate_and_encrypt_user_integrations()await backend.data.graph.fix_llm_provider_credentials()- initialize_launchdarkly()- yield- shutdown_launchdarkly()+ with launch_darkly_context():+ yieldawait backend.data.db.disconnect()