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 [10.7.7.5] (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 83D3E7E3B8; Tue, 3 Jan 2023 06:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672728864; bh=MoLLr51OXJjOklsCJcMZjnXT6p/geusKwsKf3DYLhp0=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=nq2e38yCsuqtoE+v49+Yov/Y2q20Jl0tlCxtEdgOLDeTep3ZdMIHWkcAJ/kfqIlC4 hnpv7yUKb07f9td47Dzy1okbBW/6H+Ao1CyaRfS7/bw7nZRztUtQRbYww2gnP75HBu xg/Qc9wbqEJWdKZD8h26n/H6qK3o8q2m4Bs0ZJcG5FPWeGmN2gdDnSx/kJybW987kD nDEUR7aFBA2dfVcVjdGP3kYYmqKr9QSr/8EXFvGpZ0SUZmME9SkvZ1n02xVuobz6Ws rZ7xAL5jGLfXjMUjFmxXPGcTveftAj4g+x9Njm9nJH7NHRTZLfsy2VCaDmd80naQvS QEA/2nFU5nbiw== Message-ID: <5fa120d7-32ab-b560-0c8f-0da64546cf0b@gnuweeb.org> Date: Tue, 3 Jan 2023 13:54:20 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20230103063641.1680-1-kiizuha@gnuweeb.org> <20230103063641.1680-4-kiizuha@gnuweeb.org> From: Ammar Faizi Subject: Re: [PATCH v1 03/13] refactor(telegram)!: Ensure the Telegram bot has been started In-Reply-To: <20230103063641.1680-4-kiizuha@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 1/3/23 1:36 PM, Muhammad Rizki wrote: > @@ -58,9 +59,11 @@ def main(): > scraper=Scraper(), > mutexes=BotMutexes() > ) > - sched.start() > + > + client.start() > bot.run() > - client.run() > + idle() > + client.stop() I agree to have an 'idle()' call, but it addresses a different issue w.r.t. the patch subject. Please split the 'idle()' patch into a separate patch. My understanding is that the reason for the 'idle()' call is to make the program gracefully exits when it's interrupted (e.g., SIGINT with CTRL + C), then you have a chance to call 'client.stop()', which could be a necessary cleanup to stop the app. Is my understanding correct? -- Ammar Faizi