mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
Improved rabbitmq connection lost recovery
This commit is contained in:
parent
95eb44a87f
commit
46d1a31441
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
import pika
|
import pika
|
||||||
from pika.exceptions import ChannelWrongStateError
|
from pika.exceptions import ChannelWrongStateError, StreamLostError
|
||||||
|
|
||||||
from radicale import hook
|
from radicale import hook
|
||||||
from radicale.hook import HookNotificationItem
|
from radicale.hook import HookNotificationItem
|
||||||
|
@ -39,7 +39,8 @@ class Hook(hook.BaseHook):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if isinstance(e, ChannelWrongStateError) and recall:
|
if (isinstance(e, ChannelWrongStateError) or
|
||||||
|
isinstance(e, StreamLostError)) and recall:
|
||||||
self._make_connection_synced()
|
self._make_connection_synced()
|
||||||
self._notify(notification_item, False)
|
self._notify(notification_item, False)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue