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:
parent
05b235c38b
commit
71514a97fa
@ -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")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user