Author: bklaas
Date: Mon Apr 12 12:55:24 2010
New Revision: 8689

URL: http://svn.slimdevices.com/jive?rev=8689&view=rev
Log:
Bug: 15663
Description: revert previous WOL bug checkin, as Stefan pointed out correctly 
that adjusting the countdown to the timer in init() was a useless change
change the lead time for the WOL packet from 10 minutes to 5 minutes, in hopes 
this helps the situation

Modified:
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua?rev=8689&r1=8688&r2=8689&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
 Mon Apr 12 12:55:24 2010
@@ -65,24 +65,15 @@
                        true
        )
 
-       local wolLeadTime = 1000 * 60 * 5 -- 5 minutes
-       -- Bug 15663: send wol packet well before alarm time
-       -- if timeToAlarm is less than wolLeadTime, send the wakeOnLan packet 
immediately as a best effort
-       if self.server and timeToAlarm and timeToAlarm < wolLeadTime then
-               self.server:wakeOnLan()
-       -- if startTimer is true and timeToAlarm >= wolLeadTime, send a wol 
packet wolLeadTime in front of timeToAlarm
-       elseif startTimer then
-               local wakeUp = timeToAlarm - wolLeadTime
-               self.wakeOnLanTimer = Timer(wakeUp,
-                               function()
-                                       if self.server then
-                                               log:warn('WOL packet being sent 
to ', self.server)
-                                               self.server:wakeOnLan()
-                                       end
-                               end,
-                               true
-               )
-       end
+       self.wakeOnLanTimer = Timer(86400000, -- arbitrary countdown, as timer 
interval will be set by _startTimer(), not here
+                       function()
+                               if self.server then
+                                       log:warn('WOL packet being sent to ', 
self.server)
+                                       self.server:wakeOnLan()
+                               end
+                       end,
+                       true
+       )
 
        self.statusPoller = Timer(1000, 
                function ()
@@ -675,14 +666,18 @@
                self.RTCAlarmTimer:setInterval(sleepMsecs)
                self.debugRTCTime = sleepMsecs
 
-               -- WOL timer is set when sleepMsecs is more than 11 minutes 
away (660,000 msecs)
-               if sleepMsecs > 660000 then
-                       self.wakeOnLanTimer:setInterval(sleepMsecs - 600000)
+               -- WOL timer is set when sleepMsecs is more than 5:00 away
+               local wolLeadTime = 1000 * 60 * 5 -- 5 minutes
+               if sleepMsecs > wolLeadTime then
+                       self.wakeOnLanTimer:setInterval(sleepMsecs - 5100)
                        if self.wakeOnLanTimer:isRunning() then
                                self.wakeOnLanTimer:restart()
                        else
                                self.wakeOnLanTimer:start()
                        end
+               -- if it's withing 5 minutes, send a WOL packet as a best effort
+               elseif self.server then
+                       self.server:wakeOnLan()
                end
        end
        self.RTCAlarmTimer:start()

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to