Delaying fs sync to ensure shutdown message is logged to disk

Signed-off-by: grokbeer <1428380+grokbeer@users.noreply.github.com>
This commit is contained in:
grokbeer 2020-05-08 21:56:08 +12:00
parent 05b235c38b
commit 71514a97fa

View File

@ -106,12 +106,6 @@ def temperature(celsius=True):
def shutdown():
logging.warning("syncing...")
from pwnagotchi import fs
for m in fs.mounts:
m.sync()
logging.warning("shutting down ...")
from pwnagotchi.ui import view
@ -119,6 +113,13 @@ def shutdown():
view.ROOT.on_shutdown()
# give it some time to refresh the ui
time.sleep(10)
logging.warning("syncing...")
from pwnagotchi import fs
for m in fs.mounts:
m.sync()
os.system("sync")
os.system("halt")