(self)
| 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): |
nothing calls this directly
no test coverage detected