Skip to content

Commit

Permalink
feat(main.py): exclude subgraphs from processing with an argument
Browse files Browse the repository at this point in the history
Signed-off-by: Tümay Tuzcu <tumay@semiotic.ai>
  • Loading branch information
tumaysem committed Jan 6, 2023
1 parent e497d80 commit 42c5d1c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion autoagora/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@
help="Activates the relative query cost discovery. Otherwise only builds a default "
"query pricing model with automated market price discovery.",
)
argsparser.add_argument(
"--exclude-subgraphs",
env_var="EXCLUDE_SUBGRAPHS",
required=False,
help="Comma delimited list of subgraphs (ipfs hash) to exclude from model updates.",
)

parsed_args, remaining_args = argsparser.parse_known_args()
experimental_model_builder = parsed_args.experimental_model_builder
excluded_subgraphs = set((parsed_args.exclude_subgraphs or "").split(","))

del parsed_args
if experimental_model_builder:
from autoagora.model_builder import model_update_loop
Expand All @@ -50,7 +59,7 @@ async def allocated_subgraph_watcher():

while True:
try:
allocated_subgraphs = await get_allocated_subgraphs()
allocated_subgraphs = (await get_allocated_subgraphs()) - excluded_subgraphs
except:
logging.exception(
"Exception occurred while getting the currently allocated subgraphs."
Expand Down

0 comments on commit 42c5d1c

Please sign in to comment.