Merge pull request #872 from grokbeer/shutdown-sync

Delaying fs sync to ensure shutdown message is logged to disk
This commit is contained in:
Simone Margaritelli 2020-06-26 14:14:32 +02:00 committed by GitHub
commit 2708fd032c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")