diff --git a/core/actors/_feed.py b/core/actors/_feed.py index 5224bf96..299ee0bc 100644 --- a/core/actors/_feed.py +++ b/core/actors/_feed.py @@ -44,7 +44,9 @@ def collector(self) -> "DataCollector": return self._collector def on_stop(self): - asyncio.create_task(self.collector.stop()) + stop_task = asyncio.create_task(self.collector.stop()) + self._tasks.add(stop_task) + stop_task.add_done_callback(self._tasks.discard) def pre_receive(self, msg) -> bool: return FeedPolicy.should_process(self, msg)