Browse Source

Revert "Remove circular dependency on settings (#25909)" (#26051)

* fix: Remove shellcheck-py from pre-commit setup

* Revert "Remove circular dependency on settings (#25909)"

This reverts commit 72b07cf1e5e08b6c9b84076eb8f272adaf6f5edc.
Armen Zambrano G 3 years ago
parent
commit
453f1f92a8
1 changed files with 11 additions and 4 deletions
  1. 11 4
      src/sentry/conf/server.py

+ 11 - 4
src/sentry/conf/server.py

@@ -1572,6 +1572,15 @@ SENTRY_USE_CDC_DEV = False
 #     }
 # }
 
+POSTGRES_INIT_DB_VOLUME = (
+    {
+        os.path.join(CDC_CONFIG_DIR, "init_hba.sh"): {
+            "bind": "/docker-entrypoint-initdb.d/init_hba.sh"
+        }
+    }
+    if SENTRY_USE_CDC_DEV
+    else {}
+)
 
 SENTRY_DEVSERVICES = {
     "redis": {
@@ -1600,9 +1609,7 @@ SENTRY_DEVSERVICES = {
             "postgres": {"bind": "/var/lib/postgresql/data"},
             "wal2json": {"bind": "/wal2json"},
             CDC_CONFIG_DIR: {"bind": "/cdc"},
-            os.path.join(CDC_CONFIG_DIR, "init_hba.sh"): {
-                "bind": "/docker-entrypoint-initdb.d/init_hba.sh"
-            },
+            **POSTGRES_INIT_DB_VOLUME,
         },
         "command": [
             "postgres",
@@ -1613,7 +1620,7 @@ SENTRY_DEVSERVICES = {
             "-c",
             "max_wal_senders=1",
         ],
-        "entrypoint": "/cdc/postgres-entrypoint.sh",
+        "entrypoint": "/cdc/postgres-entrypoint.sh" if SENTRY_USE_CDC_DEV else None,
         "healthcheck": {
             "test": ["CMD", "pg_isready", "-U", "postgres"],
             "interval": 30000000000,  # Test every 30 seconds (in ns).