Skip to content

Commit

Permalink
Filter out new relation
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Feb 7, 2024
1 parent 12cc43a commit 3fff3ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def _get_relation_databases(self, filter_relation=None) -> List[Dict[str, str]]:
admin = None
if "admin" in roles or "superuser" in roles:
admin = f"relation_id_{rel_id}"
if database and relation.id != filter_relation:
if database and rel_id != filter_relation:
db_list = database.split(",")
for db in db_list:
record = {
Expand Down
2 changes: 1 addition & 1 deletion src/relations/pgbouncer_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _on_relation_broken(self, event: RelationBrokenEvent) -> None:
self.charm.peers.unit_databag.pop(self._depart_flag(event.relation), None)
return

self.charm.render_pgb_config(reload_pgbouncer=True)
self.charm.render_pgb_config(reload_pgbouncer=True, filter_relation=event.relation.id)

# Delete the user.
try:
Expand Down

0 comments on commit 3fff3ba

Please sign in to comment.