mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 12:21:21 +00:00
Fix stored messages growing infinitely on reloads
This commit is contained in:
parent
7376504dd2
commit
bd6cdc5409
@ -47,6 +47,7 @@ class TFWServer:
|
||||
def handle_recover(self, message):
|
||||
if message['key'] == 'recover':
|
||||
self._frontend_messages.replay_messages(self._uplink_connector)
|
||||
self._frontend_messages.clear()
|
||||
|
||||
def save_frontend_messages(self, message):
|
||||
self._frontend_messages.save_message(message)
|
||||
@ -70,6 +71,9 @@ class MessageStorage(ABC):
|
||||
def transform_message(self, message): # pylint: disable=no-self-use
|
||||
yield message
|
||||
|
||||
def clear(self):
|
||||
self.saved_messages.clear()
|
||||
|
||||
|
||||
class FrontendMessageStorage(MessageStorage):
|
||||
def filter_message(self, message):
|
||||
|
Loading…
Reference in New Issue
Block a user