From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.126.183]) by gnuweeb.org (Postfix) with ESMTPSA id 618FE80E88; Thu, 27 Oct 2022 16:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666889697; bh=O57xiytzuIfGuOeEWR9tFV3/RBV8DfidsYhTmX9Vi9s=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=pzLs/oVena4a54dElWMQAO4sQzqBExR6/mCssPDeFR940FA4X183c/AzT1YW/5Uj1 XLMqrBY9SKgtjEL6y11hrZ4iqLSTl+WPKHksWYC/sJk+rT9DRVEKJ8zrFIfgsaSztC K5cUtfDHctlmHnEj9kBY7xn6Sker5JEHmdRzyAK9BHos4x5TCjbGeWf2Y4MRKSopIB r54fb5tufWM9tmXJzrM/ALatb0ORFjFeL6cXS1WK0Z90OXw8cX8cM/Z5V3TX12z2BS /sRazNpTXcu2QA7e8/K30sp/jwVkmnR33So1Nt4SVl/lsps8rzntXj4ze5Z8ZVqpJM j7DZFFjLeOcCQ== Message-ID: <714e2cc2-7917-40ef-06cb-c1c8f3d5c1d6@gnuweeb.org> Date: Thu, 27 Oct 2022 23:54:54 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v1 1/2] daemon: telegram: db: Allow the caller to reconnect Content-Language: en-US From: Muhammad Rizki To: Ammar Faizi , GNU/Weeb Mailing List Cc: Alviro Iskandar Setiawan References: <20221027150823.601914-1-ammarfaizi2@gnuweeb.org> <20221027150823.601914-2-ammarfaizi2@gnuweeb.org> <03285f18-3d91-75c3-7f9a-35edd13e08bb@gnuweeb.org> In-Reply-To: <03285f18-3d91-75c3-7f9a-35edd13e08bb@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 27/10/2022 23.52, Muhammad Rizki wrote: > On 27/10/2022 22.08, Ammar Faizi wrote: >> +    def connect(self): >> +        if self.conn: >> +            self.close() >> + >> +        self.conn = connector.connect( > > Have you tried the ping() method? > > Refer: > http://www.neotitans.com/resources/python/mysql-python-connection-error-2006.html Sorry, I mean this: https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-ping.html