Added 1s wait time to snapshot creation

If the snapshot is created too quickly, a user can make another snapshot with the same epoch time. So this will add a 1 second wait time if the snapshot is done being made really quickly to avoid that.
This commit is contained in:
heliguy
2023-11-14 11:28:55 -05:00
parent 766c5f6ae3
commit ecc6eabe73

View File

@@ -131,7 +131,8 @@ class SnapshotsWindow(Adw.Window):
except subprocess.CalledProcessError as e:
print("Error in snapshots_windopw.py: createSnapshot():", e)
GLib.idle_add(lambda *_a: self.toast_overlay.add_toast(Adw.Toast.new(_("Could not create snapshot"))))
return
if(int(time.time()) == epoch):
subprocess.run(['sleep', '1s'])
# `tar -tf filepath` to see the contents of a tar file