Skip to content

Commit

Permalink
producer and consumer are mutually exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
toluaina committed Jan 2, 2024
1 parent f6fcbc3 commit a479afc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pgsync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,14 +1339,18 @@ def receive(self) -> None:
@click.option(
"--producer",
is_flag=True,
default=True,
default=None,
help="Run as a producer only",
cls=MutuallyExclusiveOption,
mutually_exclusive=["consumer"],
)
@click.option(
"--consumer",
is_flag=True,
help="Run as a consumer only",
default=True,
default=None,
cls=MutuallyExclusiveOption,
mutually_exclusive=["producer"],
)
@click.option(
"--polling",
Expand Down Expand Up @@ -1451,6 +1455,13 @@ def main(

show_settings(config)

if producer:
consumer = False
elif consumer:
producer = False
else:
consumer = producer = True

with Timer():
if analyze:
for doc in config_loader(config):
Expand Down

0 comments on commit a479afc

Please sign in to comment.