Skip to content

Commit

Permalink
always update instance catalogs list (dmitryduev#31)
Browse files Browse the repository at this point in the history
This PR makes sure that the 'get_catalogs' and by extension 'get_all_catalogs' method updates the list every time.
  • Loading branch information
Theodlz authored Jun 30, 2023
1 parent 30ccca6 commit 78e310d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions penquins/penquins.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ def add(self, name, cfg, **kwargs):
if len(self.instances) > 1:
self.multiple_instances = True

catalogs = self.get_catalogs(name)
self.instances[name]["catalogs"] = catalogs
self.get_catalogs(name) # get catalogs for this instance

except Exception as e:
del self.instances[name]
Expand Down Expand Up @@ -420,7 +419,8 @@ def get_catalogs(self, name=None) -> dict:
},
}
response = self.single_query((query, name))
return response[name].get("data")
self.instances[name]["catalogs"] = response.get(name, {}).get("data", [])
return self.instances[name]["catalogs"]

def get_catalogs_all(self) -> dict:
catalogs = {}
Expand Down

0 comments on commit 78e310d

Please sign in to comment.