Skip to content

Commit

Permalink
chore: clean up Dispatcher variable orders
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Sep 21, 2024
1 parent 3852f03 commit 1b64a92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/planai/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def get_inheritance_chain(cls: Type[TaskWorker]) -> List[str]:
class Dispatcher:
def __init__(self, graph: "Graph", web_port=5000):
self.graph = graph
self.web_port = web_port

# We have a default Queue for all tasks
self.work_queue = Queue()

Expand All @@ -133,8 +135,7 @@ def __init__(self, graph: "Graph", web_port=5000):
self.notifiers_lock = Lock()
self.stop_event = Event()
self._active_tasks = 0
self.task_completion_event = threading.Event()
self.web_port = web_port
self.task_completion_event = Event()
self.debug_active_tasks: Dict[int, Tuple[TaskWorker, Task]] = {}
self.completed_tasks: Deque[Tuple[TaskWorker, Task]] = deque(
maxlen=100
Expand All @@ -148,7 +149,7 @@ def __init__(self, graph: "Graph", web_port=5000):
self.total_completed_tasks = 0
self.total_failed_tasks = 0
self.task_id_counter = 0
self.task_lock = threading.Lock()
self.task_lock = Lock()

@property
def active_tasks(self):
Expand Down

0 comments on commit 1b64a92

Please sign in to comment.