From a54f4683508be4b683d3501100cd60c68ce5bb13 Mon Sep 17 00:00:00 2001 From: Felix Leupold Date: Mon, 15 Jul 2024 18:57:40 +0200 Subject: [PATCH] remove optional env vars from critical path (#105) --- src/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 0bcba008..7dacef92 100644 --- a/src/main.py +++ b/src/main.py @@ -47,9 +47,7 @@ def __init__(self) -> None: if __name__ == "__main__": load_dotenv() - volume_path = Path(os.environ["VOLUME_PATH"]) args = ScriptArgs() - aws = AWSClient.new_from_environment() dune = DuneClient(os.environ["DUNE_API_KEY"]) orderbook = OrderbookFetcher() @@ -65,6 +63,8 @@ def __init__(self) -> None: ) ) elif args.sync_table == SyncTable.ORDER_REWARDS: + aws = AWSClient.new_from_environment() + volume_path = Path(os.environ["VOLUME_PATH"]) sync_order_rewards( aws, config=SyncConfig(volume_path), @@ -72,6 +72,8 @@ def __init__(self) -> None: dry_run=args.dry_run, ) elif args.sync_table == SyncTable.BATCH_REWARDS: + aws = AWSClient.new_from_environment() + volume_path = Path(os.environ["VOLUME_PATH"]) sync_batch_rewards( aws, config=SyncConfig(volume_path),