From 75d299ef6fe15a705f39e53f713ff1d16f837c8b Mon Sep 17 00:00:00 2001 From: Austin Stark <14080242+ausmaster@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:45:55 -0700 Subject: [PATCH] Implement toggling off/on of reconciling MongoDB indexes. --- bbot_server/applets/_root.py | 2 +- bbot_server/config.py | 3 +++ compose.yml | 2 ++ helm/templates/worker-deployment.yaml | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bbot_server/applets/_root.py b/bbot_server/applets/_root.py index eb80076d..1e7bae9b 100644 --- a/bbot_server/applets/_root.py +++ b/bbot_server/applets/_root.py @@ -45,7 +45,7 @@ async def setup(self): await self._setup() # Reconcile indexes after all applets are set up - if self.is_native: + if self.is_native and bbcfg.reconcile_indexes: await self.reconcile_all_indexes() return True, "" diff --git a/bbot_server/config.py b/bbot_server/config.py index f3c9b872..852b6545 100644 --- a/bbot_server/config.py +++ b/bbot_server/config.py @@ -84,6 +84,9 @@ class BBOTServerSettings(BaseSettings): user_store: StoreConfig message_queue: MessageQueueConfig + # index management + reconcile_indexes: bool = True + # misc nested config we know about agent: Optional[AgentConfig] = Field(default_factory=AgentConfig) cli: Optional[CLIConfig] = Field(default_factory=CLIConfig) diff --git a/compose.yml b/compose.yml index f998eb7f..9555206b 100644 --- a/compose.yml +++ b/compose.yml @@ -28,6 +28,8 @@ services: worker: <<: *bbot-server-base command: ["bbctl", "server", "start", "--worker-only"] + environment: + - BBOT_SERVER_RECONCILE_INDEXES=false depends_on: server: condition: service_healthy diff --git a/helm/templates/worker-deployment.yaml b/helm/templates/worker-deployment.yaml index ac530c91..5ce81fed 100644 --- a/helm/templates/worker-deployment.yaml +++ b/helm/templates/worker-deployment.yaml @@ -62,6 +62,9 @@ spec: secretKeyRef: name: {{ .Values.redis.auth.existingSecret | default (printf "%s-redis" .Release.Name) | quote }} key: redis-password + # Index reconciliation is handled by Server, not the worker + - name: BBOT_SERVER_RECONCILE_INDEXES + value: "false" # BBOT Server configuration - name: BBOT_SERVER_URL value: "http://{{ .Release.Name }}-server:{{ .Values.server.service.port }}/v1/"