Skip to content

Commit

Permalink
Checker: fix type error
Browse files Browse the repository at this point in the history
It looks like database.get_check_duration() now returns a
decimal.Decimal instead of a float causing the launch_timeframe
calculation to fail with:

    TypeError: unsupported operand type(s) for -: 'float' and 'decimal.Decimal'
  • Loading branch information
rudis committed Sep 1, 2023
1 parent 0bd5eae commit 1bac9dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ctf_gameserver/checker/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ def update_launch_params(self, tick):
if check_duration is None:
# No complete flag placements so far
check_duration = self.tick_duration.total_seconds()
check_duration = float(check_duration)

total_tasks = database.get_task_count(self.db_conn, self.service['id'])
local_tasks = math.ceil(total_tasks / self.checker_count)
Expand Down

0 comments on commit 1bac9dd

Please sign in to comment.