-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Changelog: - Fix(backend): Centrifugo freezing in sync contexts.
- Loading branch information
1 parent
f177cfb
commit 37c3bcc
Showing
4 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
from cent import AsyncClient as CentrifugoClient, CentRequest | ||
from cent import AsyncClient as AsyncCentrifugoClient, Client as SyncCentrifugoClient, CentRequest | ||
from vstutils.models.cent_notify import Notificator | ||
|
||
|
||
messages_log: list[CentRequest] = [] | ||
|
||
|
||
class Client(CentrifugoClient): | ||
class Client(AsyncCentrifugoClient): | ||
async def _send(self, request: CentRequest, *args, **kwargs): | ||
messages_log.append(request) | ||
|
||
|
||
class SyncClient(SyncCentrifugoClient): | ||
def _send(self, request: CentRequest, *args, **kwargs): | ||
messages_log.append(request) | ||
|
||
|
||
class DummyNotificator(Notificator): | ||
client_class = Client | ||
sync_client_class = SyncClient | ||
|
||
def is_usable(self): | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# pylint: disable=django-not-available | ||
__version__: str = '5.12.1' | ||
__version__: str = '5.12.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters