MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / wakeupWatcher

Method wakeupWatcher

src/File/FileServer.py:334–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

332
333 # Detects if computer back from wakeup
334 def wakeupWatcher(self):
335 last_time = time.time()
336 while 1:
337 time.sleep(30)
338 if time.time() - max(self.last_request, last_time) > 60 * 3:
339 # If taken more than 3 minute then the computer was in sleep mode
340 self.log.info(
341 "Wakeup detected: time warp from %s to %s (%s sleep seconds), acting like startup..." %
342 (last_time, time.time(), time.time() - last_time)
343 )
344 self.checkSites(check_files=False, force_port_check=True)
345 last_time = time.time()
346
347 # Bind and start serving sites
348 def start(self, check_sites=True):

Callers

nothing calls this directly

Calls 1

checkSitesMethod · 0.95

Tested by

no test coverage detected