From bb152eb27b04fbd8d0739b0d80b32564756aa3a7 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 12 Dec 2008 23:50:20 +0000 Subject: [PATCH] Extract scheduleRegularReboot() into a method. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5604 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/server/RebootManager.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/server/RebootManager.java b/src/java/com/threerings/presents/server/RebootManager.java index 7878d4cd2..09950da27 100644 --- a/src/java/com/threerings/presents/server/RebootManager.java +++ b/src/java/com/threerings/presents/server/RebootManager.java @@ -59,14 +59,24 @@ public abstract class RebootManager } /** - * Finish initialization of the manager. + * Finishes initialization of the manager. */ public void init () + { + scheduleRegularReboot(); + } + + /** + * Schedules our next regularly scheduled reboot. + * + * @return true if a reboot was scheduled, false if regularly scheduled reboots are disabled. + */ + public boolean scheduleRegularReboot () { // maybe schedule an automatic reboot based on our configuration int freq = getDayFrequency(); if (freq == -1) { - return; + return false; } Calendar cal = Calendar.getInstance(); @@ -95,6 +105,7 @@ public abstract class RebootManager } scheduleReboot(cal.getTimeInMillis(), "automatic"); + return true; } /**