diff --git a/services/xmpp_client.py b/services/xmpp_client.py index dd7158e..65a5555 100644 --- a/services/xmpp_client.py +++ b/services/xmpp_client.py @@ -465,11 +465,15 @@ class XMPPClient(ClientXMPP): async def _run(self): self._stopped = asyncio.Event() self._loop = asyncio.get_running_loop() - for sig in (signal.SIGTERM, signal.SIGHUP): - try: - self._loop.add_signal_handler(sig, self._stopped.set) - except NotImplementedError: - pass + + # Hanya tangani SIGTERM untuk shutdown. + # SENGATKAN SIGHUP: nohup kirim SIGHUP saat terminal close, + # dan kita tidak mau proses mati karena itu. + try: + self._loop.add_signal_handler(signal.SIGTERM, self._stopped.set) + except NotImplementedError: + pass + await self.connect() try: await self._stopped.wait()