diff options
author | Veena Arvind <aveena@google.com> | 2023-12-12 19:56:58 +0000 |
---|---|---|
committer | Veena Arvind <aveena@google.com> | 2023-12-12 19:56:58 +0000 |
commit | ed626379d0583a2b87f585306b3ece4e8caa6971 (patch) | |
tree | d889fe893211578cb09679ed14ae5fabea1af4d2 | |
parent | c60dfd0388780d0fd385876537c3a813ce685b88 (diff) | |
download | ConfigInfrastructure-ed626379d0583a2b87f585306b3ece4e8caa6971.tar.gz |
Change reboot time to be at 12 minutes.
We've been receiving some ddos errors for the RoR server. Typically,
there's more traffic at the top of the hour so let's offset the time.
Test: atest ConfigInfrastructureServiceUnitTests[com.google.android.configinfrastructure.apex]
Change-Id: I915dbb6b401285ad09fe1ed544b93bf9c2f43fe2
-rw-r--r-- | service/java/com/android/server/deviceconfig/UnattendedRebootManager.java | 2 | ||||
-rw-r--r-- | service/javatests/src/com/android/server/deviceconfig/UnattendedRebootManagerTest.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/service/java/com/android/server/deviceconfig/UnattendedRebootManager.java b/service/java/com/android/server/deviceconfig/UnattendedRebootManager.java index f52cbe5..30f2439 100644 --- a/service/java/com/android/server/deviceconfig/UnattendedRebootManager.java +++ b/service/java/com/android/server/deviceconfig/UnattendedRebootManager.java @@ -200,7 +200,7 @@ final class UnattendedRebootManager { .atZone(mInjector.zoneId()) .toLocalDate() .plusDays(mInjector.getRebootFrequency()) - .atTime(mInjector.getRebootStartTime(), /* minute= */ 0); + .atTime(mInjector.getRebootStartTime(), /* minute= */ 12); long rebootTimeMillis = timeToReboot.atZone(mInjector.zoneId()).toInstant().toEpochMilli(); Log.v(TAG, "Scheduling unattended reboot at time " + timeToReboot); diff --git a/service/javatests/src/com/android/server/deviceconfig/UnattendedRebootManagerTest.java b/service/javatests/src/com/android/server/deviceconfig/UnattendedRebootManagerTest.java index a0579f1..0ddbc64 100644 --- a/service/javatests/src/com/android/server/deviceconfig/UnattendedRebootManagerTest.java +++ b/service/javatests/src/com/android/server/deviceconfig/UnattendedRebootManagerTest.java @@ -45,11 +45,11 @@ public class UnattendedRebootManagerTest { private static final int REBOOT_END_HOUR = 3; private static final long CURRENT_TIME = 1696452549304L; // 2023-10-04T13:49:09.304 - private static final long REBOOT_TIME = 1696496400000L; // 2023-10-05T02:00:00 - private static final long RESCHEDULED_REBOOT_TIME = 1696582800000L; // 2023-10-06T02:00:00 + private static final long REBOOT_TIME = 1696497120000L; // 2023-10-05T02:12:00 + private static final long RESCHEDULED_REBOOT_TIME = 1696583520000L; // 2023-10-06T02:12:00 private static final long OUTSIDE_WINDOW_REBOOT_TIME = 1696587000000L; // 2023-10-06T03:10:00 private static final long RESCHEDULED_OUTSIDE_WINDOW_REBOOT_TIME = - 1696669200000L; // 2023-10-07T02:00:00 + 1696669920000L; // 2023-10-07T02:12:00 private static final long ELAPSED_REALTIME_1_DAY = 86400000L; private Context mContext; |