Fix positional args

This commit is contained in:
Adrià Casajús 2024-07-25 17:03:55 +02:00
parent 32488284ec
commit 02b506ba0f
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9

View File

@ -28,7 +28,7 @@ class Mode(Enum):
def main(mode: Mode, dry_run: bool, max_retries: int): def main(mode: Mode, dry_run: bool, max_retries: int):
if mode == Mode.DEAD_LETTER: if mode == Mode.DEAD_LETTER:
LOG.i("Using DeadLetterEventSource") LOG.i("Using DeadLetterEventSource")
source = DeadLetterEventSource() source = DeadLetterEventSource(max_retries)
elif mode == Mode.LISTENER: elif mode == Mode.LISTENER:
LOG.i("Using PostgresEventSource") LOG.i("Using PostgresEventSource")
source = PostgresEventSource(DB_URI) source = PostgresEventSource(DB_URI)
@ -57,6 +57,7 @@ def args():
"max_retries", "max_retries",
help="Max retries to consider an event as error and not try to process it again", help="Max retries to consider an event as error and not try to process it again",
type=int, type=int,
nargs="?",
default=_DEFAULT_MAX_RETRIES, default=_DEFAULT_MAX_RETRIES,
) )
parser.add_argument("--dry-run", help="Dry run mode", action="store_true") parser.add_argument("--dry-run", help="Dry run mode", action="store_true")