Skip to content

Commit 0a8bfc5

Browse files
committed
fix(www): do not call storage-flush endpoint
We have different queues for the data and control planes: the javascript code may have sent the entire file to the websocket but the browser will have it enqueued into its own queue. With calls we make being asynchronous, remove the unnecessary call to the storage-flush endpoint: we will be notified when the agent has finished processing the queue (with a CORRUPTED or INITIALIZED event). Signed-off-by: Cedric Hombourger <[email protected]>
1 parent ca18f27 commit 0a8bfc5

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

mtda-www

-12
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,6 @@ class PowerToggleHandler(BaseHandler):
140140
self.result_as_json({"result": result})
141141

142142

143-
class StorageFlushHandler(BaseHandler):
144-
def get(self):
145-
mtda = self.application.settings['mtda']
146-
result = ''
147-
if mtda is not None:
148-
size = int(self.get_argument('size'))
149-
sid = self.get_argument('session')
150-
result = mtda.storage_flush(size=size, session=sid)
151-
self.result_as_json({"result": result})
152-
153-
154143
class StorageOpenHandler(BaseHandler):
155144
def get(self):
156145
mtda = self.application.settings['mtda']
@@ -298,7 +287,6 @@ class Service:
298287
(r"/keyboard-input", KeyboardInputHandler),
299288
(r"/power-toggle", PowerToggleHandler),
300289
(r"/storage-close", StorageCloseHandler),
301-
(r"/storage-flush", StorageFlushHandler),
302290
(r"/storage-open", StorageOpenHandler),
303291
(r"/storage-toggle", StorageToggleHandler),
304292
], template_path=os.path.join(BASE_DIR, "templates"),

mtda/templates/index.html

-3
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@
463463
await delay(5);
464464
}
465465
socket.send(new Uint8Array([]));
466-
$.getJSON('./storage-flush', {
467-
size: file.size, session: localStorage.getItem('session')
468-
}, function(data) { });
469466
}
470467
await sendFileInChunks(selectedFile);
471468
}

0 commit comments

Comments
 (0)