Skip to content

Commit

Permalink
fallback/no_make_active
Browse files Browse the repository at this point in the history
let the intent service handle this, unittests in core uncovered duplicate messages this commit is fixing
  • Loading branch information
JarbasAl committed Sep 30, 2023
1 parent a57c4a5 commit 83b3bca
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions ovos_workshop/skills/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,8 @@ def register_fallback(self, handler: Callable[[Message], None],
# check if .conf is overriding the priority for this skill
priority = priority_overrides.get(self.skill_id, priority)

def wrapper(*args, **kwargs):
if handler(*args, **kwargs):
self.activate()
return True
return False

self.instance_fallback_handlers.append(handler)
self._register_fallback(handler, wrapper, priority)
self._register_fallback(handler, handler, priority)

@classmethod
def _remove_registered_handler(cls, wrapper_to_del: callable) -> bool:
Expand Down Expand Up @@ -403,15 +397,8 @@ def register_fallback(self, handler: callable, priority: int):

LOG.info(f"registering fallback handler -> "
f"ovos.skills.fallback.{self.skill_id}")

def wrapper(*args, **kwargs):
if handler(*args, **kwargs):
self.activate()
return True
return False

self._fallback_handlers.append((priority, wrapper))
self.bus.on(f"ovos.skills.fallback.{self.skill_id}", wrapper)
self._fallback_handlers.append((priority, handler))
self.bus.on(f"ovos.skills.fallback.{self.skill_id}", handler)

def default_shutdown(self):
"""
Expand Down

0 comments on commit 83b3bca

Please sign in to comment.