Skip to content

Commit 20fd535

Browse files
committed
feat: store federation in dedicated DB column
1 parent 5bac245 commit 20fd535

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

stac_fastapi/eodag/dag.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,21 @@ def init_dag(app: FastAPI) -> None:
7777

7878
# update eodag collections config from external stac collections
7979
collections = {}
80+
status = {}
8081
for c in dag.list_collections():
8182
if ext_coll := ext_stac_collections.get(c.id):
8283
collection = ext_coll
8384
collection["id"] = c._id
8485
collection["alias"] = c.id
86+
if federation := collection.pop("federation", None):
87+
status[c._id] = federation
8588
collections[c._id] = collection
8689

8790
dag.db.upsert_collections(CollectionsDict.from_configs(collections))
8891

92+
# store status in a separate column to avoid federation to be overwritten by subsequent upsert_collections() calls
93+
dag.db.set_status(status)
94+
8995
# pre-build search plugins
9096
for provider in dag.providers:
9197
next(dag._plugins_manager.get_search_plugins(provider=provider))

0 commit comments

Comments
 (0)