Skip to content

Commit

Permalink
Merge pull request #604 from TeskaLabs/refactoring/schedule-threadsafe
Browse files Browse the repository at this point in the history
Discovery: refactoring - use the new functionality of task service to schedule task threadsafe
  • Loading branch information
eliska-n authored Dec 10, 2024
2 parents 2859ddc + 205e6d1 commit 630fbc5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions asab/api/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,7 @@ def get_data(item):

def _on_change_threadsafe(self, watched_event):
# Runs on a thread, returns the process back to the main thread
def _update_cache():
self.App.TaskService.schedule(self._rescan_advertised_instances())
self.App.Loop.call_soon_threadsafe(_update_cache)
self.App.TaskService.schedule_threadsafe(self._rescan_advertised_instances())


def session(
Expand Down

0 comments on commit 630fbc5

Please sign in to comment.