feat: force read-write for listener connection

This commit is contained in:
steve-chavez
2024-05-19 23:14:19 -05:00
committed by Steve Chavez
parent 3cf565614d
commit 7e61c9deb0
5 changed files with 46 additions and 25 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ def replicaenv(defaultenv):
"replica": {
**defaultenv,
**conf,
"PGHOST": os.environ["PGREPLICAHOST"],
"PGHOST": os.environ["PGREPLICAHOST"] + "," + os.environ["PGHOST"],
"PGREPLICASLOT": os.environ["PGREPLICASLOT"],
},
}
+1 -6
View File
@@ -20,12 +20,7 @@ def test_sanity_replica(replicaenv):
response = postgrest.session.get("/items?select=count")
assert response.text == '[{"count":10}]'
working_replica_env = {
**replicaenv["replica"],
"PGRST_DB_CHANNEL_ENABLED": "false", # LISTEN doesn't work on read replicas
}
with run(env=working_replica_env) as postgrest:
with run(env=replicaenv["replica"]) as postgrest:
response = postgrest.session.get("/rpc/is_replica")
assert response.text == "true"