(self)
| 349 | self.log.info("Internet offline") |
| 350 | |
| 351 | def getTimecorrection(self): |
| 352 | corrections = sorted([ |
| 353 | connection.handshake.get("time") - connection.handshake_time + connection.last_ping_delay |
| 354 | for connection in self.connections |
| 355 | if connection.handshake.get("time") and connection.last_ping_delay |
| 356 | ]) |
| 357 | if len(corrections) < 6: |
| 358 | return 0.0 |
| 359 | mid = int(len(corrections) / 2 - 1) |
| 360 | median = (corrections[mid - 1] + corrections[mid] + corrections[mid + 1]) / 3 |
| 361 | return median |
no test coverage detected