Skip to content

constants

TimeoutConf dataclass

Bases: DictMixin

Define cache timeout as a class.

Inherits the .as_dict() method from DictMixin.

Parameters:

Name Type Description Default
amount int

Amount of time to allow for timeout

field(default=15)
unit str

Unit of time corresponding with the amount passed. Examples: ["minutes", "hours", "days", etc]

field(default='minutes')
Source code in src/red_utils/ext/diskcache_utils/constants.py
@dataclass
class TimeoutConf(DictMixin):
    """Define cache timeout as a class.

    Inherits the .as_dict() method from DictMixin.

    Params:
        amount (int): Amount of time to allow for timeout
        unit (str): Unit of time corresponding with the `amount` passed. Examples: ["minutes", "hours", "days", etc]
    """

    unit: str | None = field(default="minutes")
    amount: int | None = field(default=15)