🎨 Made manager attributes more flexible
Changed run_after, retryable_on and continue_on to be type Container. We don't need them to be sets. The performance gain of sets over small tuples is nonexistant for in checks and the syntax is more verbose.
This commit is contained in:
@@ -2,7 +2,7 @@ import logging
|
||||
from abc import abstractmethod
|
||||
from threading import Lock
|
||||
from time import sleep
|
||||
from typing import Any, Callable
|
||||
from typing import Any, Callable, Container
|
||||
|
||||
from src.game import Game
|
||||
|
||||
@@ -16,11 +16,11 @@ class Manager:
|
||||
* May be retried on some specific error types
|
||||
"""
|
||||
|
||||
run_after: set[type["Manager"]] = set()
|
||||
run_after: Container[type["Manager"]] = tuple()
|
||||
blocking: bool = True
|
||||
|
||||
retryable_on: set[type[Exception]] = set()
|
||||
continue_on: set[type[Exception]] = set()
|
||||
retryable_on: Container[type[Exception]] = tuple()
|
||||
continue_on: Container[type[Exception]] = tuple()
|
||||
retry_delay: int = 3
|
||||
max_tries: int = 3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user