DmitryBurnaev / podcast-service

Podcast's API service
MIT License
3 stars 2 forks source link

Multiple background tasks can be created in WS endpoint, but only latest is cancelled #199

Open dolamroth opened 1 year ago

dolamroth commented 1 year ago

Background task is rewritten on every on_receive https://github.com/DmitryBurnaev/podcast-service/blob/efd4578f17fb9623c7267d1d8c9bac01686d8d12/src/common/views.py#L255

But only the latest is cancelled https://github.com/DmitryBurnaev/podcast-service/blob/efd4578f17fb9623c7267d1d8c9bac01686d8d12/src/common/views.py#L264

This may potentially lead to non-ending tasks after WS-connection is closed

Suggestion: