Skip to content

Commit

Permalink
Add logic to handle different corn expression for different env
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest-tpximpact committed Oct 9, 2024
1 parent b4fa916 commit e8af9c3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bin/generate_dag_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
'title-boundary',
'article-4-direction',
'central-activities-zone'
]
],
schedule='0 10 * * *' # Daily at 10 AM
),
staging=CollectionConfig(
selection=CollectionSelection.all
selection=CollectionSelection.all,
schedule='0 1 * * *' # Daily at 1 AM
),
production=CollectionConfig(
selection=CollectionSelection.none
selection=CollectionSelection.none,
schedule='0 1 * * *' # Daily at 1 AM
)
)

Expand All @@ -48,9 +51,11 @@ def collection_enabled(collection, env):
help="environment that the json is being created for. If development then a subset of collections are used",
)
def make_dag_config(output_path: Path, env: str):
env_collection_config = collection_config[env]

config_dict = {
'env': env,
'schedule': '0 11 * * *' # run everyday at 11am
'schedule': env_collection_config.schedule
}

with tempfile.TemporaryDirectory() as tmpdir:
Expand Down

0 comments on commit e8af9c3

Please sign in to comment.