Skip to content

Commit c605b3b

Browse files
committed
Fix ignore of events during app initialize()
1 parent f24497f commit c605b3b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

appdaemon/threads.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from random import randint
1414
from threading import Thread
1515
from typing import TYPE_CHECKING, Any, ClassVar
16+
1617
import iso8601
1718

1819
from . import exceptions as ade
@@ -194,10 +195,7 @@ async def create_initial_threads(self) -> None:
194195
"""
195196
match self.total_threads, self.pin_apps:
196197
case None, True:
197-
self.total_threads = self.pin_threads = (
198-
self.AD.app_management.dependency_manager.app_deps.app_config.active_app_count
199-
or 1
200-
)
198+
self.total_threads = self.pin_threads = self.AD.app_management.dependency_manager.app_deps.app_config.active_app_count or 1
201199
self.logger.info(
202200
"Starting apps with %s worker threads. Apps will all be assigned threads and pinned to them.",
203201
self.total_threads,
@@ -849,7 +847,7 @@ async def dispatch_worker(self, name: str, args: dict[str, Any]):
849847
state = await self.AD.state.get_state("_threading", "admin", f"app.{name}")
850848
if state in ["initializing"]:
851849
self.logger.warning("Incoming event while initializing - discarding")
852-
# return
850+
return
853851

854852
unconstrained = True
855853
#

0 commit comments

Comments
 (0)