diff options
author | Florian Bruhin <me@the-compiler.org> | 2024-05-06 18:44:30 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2024-05-06 18:45:06 +0200 |
commit | 245d117cd96d7e0b1f79ec41c55fb1c508350468 (patch) | |
tree | 1fbd771a338e1d8382f3effc3e361153772e8b96 | |
parent | f9ae555c841748ee2586a33fd07e985e3ef08343 (diff) | |
download | qutebrowser-245d117cd96d7e0b1f79ec41c55fb1c508350468.tar.gz qutebrowser-245d117cd96d7e0b1f79ec41c55fb1c508350468.zip |
timestamps
-rw-r--r-- | qutebrowser/misc/ipc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 9342ab55b..9f31d023c 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -6,6 +6,7 @@ import os import time +import functools import json import getpass import binascii @@ -154,7 +155,7 @@ class IPCConnection(QObject): self._timer = usertypes.Timer(self, "ipc-timeout") self._timer.setInterval(READ_TIMEOUT) - self._timer.timeout.connect(self.on_timeout) + self._timer.timeout.connect(functools.partial(self.on_timeout, time.time())) self._timer.start() self._socket: Optional[QLocalSocket] = socket @@ -219,11 +220,11 @@ class IPCConnection(QObject): if self._socket is not None: self._timer.start() - @pyqtSlot() - def on_timeout(self) -> None: + @pyqtSlot(float) + def on_timeout(self, t: float) -> None: """Cancel the current connection if it was idle for too long.""" assert self._socket is not None - log.ipc.error(f"IPC connection timed out (socket {self.conn_id}).") + log.ipc.error(f"IPC connection timed out (socket {self.conn_id}, t {t}, now {time.time()}).") self._socket.disconnectFromServer() if self._socket is not None: # pragma: no cover # on_disconnected sets it to None |