Skip to content

Bug: get_max_shutdown_timeout #93

@moconnor-oled

Description

@moconnor-oled

Description

shutdown_grace_period = getattr(worker, "_shutdown_grace_period_s", 0)
cancellation_hard_deadline = getattr(worker, "_cancellation_hard_deadline_s", 0)
grace_period = shutdown_grace_period + cancellation_hard_deadline

_shutdown_grace_period_s is instantiated in the Worker class as Optional[int] = None. getattr() will return None and grace_period = shutdown_grace_period + cancellation_hard_deadline will raise TypeError unsupported operand type(s) for +: 'NoneType' and 'float' when _shutdown_grace_period_s is not provided in QueueConfig

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

Package Version

0.7.0

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions