Skip to content

Commit

Permalink
fix bug with incorrect flag names
Browse files Browse the repository at this point in the history
  • Loading branch information
Friskes committed Jul 6, 2024
1 parent 7be840c commit d95880a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/celery_starter/management/commands/runcelery.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def run_celery(self) -> None:
subprocess.Popen(self.constr.worker_cmd, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
# subprocess.run(self.constr.worker_cmd)

if not self.options['exclude-beat']:
if not self.options['exclude_beat']:
self.read_pid_file(CELERY_BEAT_PID_FILENAME)
subprocess.Popen(self.constr.beat_cmd, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)

if not self.options['exclude-flower']:
if not self.options['exclude_flower']:
subprocess.Popen(
self.constr.flower_cmd,
stdin=subprocess.PIPE,
Expand Down Expand Up @@ -266,10 +266,10 @@ def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument('-b', '--beat', default='', type=str, help=L.beat_help)
parser.add_argument('-f', '--flower', default='', type=str, help=L.flower_help)
parser.add_argument(
'-eb', '--exclude-beat', action='store_true', default=False, help=L.exclude_beat_help
'-eb', '--exclude_beat', action='store_true', default=False, help=L.exclude_beat_help
)
parser.add_argument(
'-ef', '--exclude-flower', action='store_true', default=False, help=L.exclude_flower_help
'-ef', '--exclude_flower', action='store_true', default=False, help=L.exclude_flower_help
)
parser.add_argument('-d', '--debug', action='store_true', default=False, help=L.debug_help)

Expand All @@ -282,8 +282,8 @@ def handle(self, *args: Any, **options: Any) -> None:

self.options = options

beat = 'beat ' if not self.options['beat'] else ''
flower = 'flower ' if not self.options['flower'] else ''
beat = 'beat ' if not self.options['exclude_beat'] else ''
flower = 'flower ' if not self.options['exclude_flower'] else ''

if self.options['debug']:
msg = L.start_msg % (self.constr.celery_app, beat, flower) + L.debug_msg
Expand Down

0 comments on commit d95880a

Please sign in to comment.