Allow user-selected backup time.

This commit is contained in:
Nicholas
2023-01-25 08:55:33 -05:00
committed by Greyson Parrelli
parent a7d9bd944b
commit 8dd1d3bdeb
5 changed files with 95 additions and 1 deletions

View File

@@ -50,7 +50,9 @@ public class LocalBackupListener extends PersistentAlarmManagerListener {
nextTime = System.currentTimeMillis() + INTERVAL;
} else {
LocalDateTime now = LocalDateTime.now();
LocalDateTime next = now.withHour(2).withMinute(0).withSecond(0);
int hour = SignalStore.settings().getBackupHour();
int minute = SignalStore.settings().getBackupMinute();
LocalDateTime next = now.withHour(hour).withMinute(minute).withSecond(0);
if (now.getHour() >= 2) {
next = next.plusDays(1);
}