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=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by gnuweeb.org (Postfix) with ESMTPSA id DEB6A810FE for ; Mon, 31 Oct 2022 16:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1667233587; bh=6TTXYjzNZ1dMgfKyVp9mQUJVgAmS1TDGLA90GXE0xWI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jCHzYuSsfHlruGAmTzHGRMwHy4dd/bYNtAHKlRaKDfHEMxarzRFSrLpE66QGFKrxe gYMgxvdu32Nvgcb1MIzy6ZzPoQ8JiE6bGRkzicA7AsWJo6xNtJQlERKxenFgwgKsj9 aMXxNe/3H41laOkbKLBbNdnYCSd4CTEHAqzR77r1bGviDlXTydbtafFzKSuEtnUlpg yqAj3MsuATGIGMmtuWLQZenKq5jLwwyBFlNG241n3peSihP7oJhRSSNfXQ6O098Tcx i51DMZllhedjx9jhmccDN+UFHo+vcI/wfuqe4cPXPalKwONF1JU18KHn4sdV+xWhDz JLvfRv2F6eS4g== Received: by mail-lf1-f51.google.com with SMTP id b2so20048612lfp.6 for ; Mon, 31 Oct 2022 09:26:27 -0700 (PDT) X-Gm-Message-State: ACrzQf0JK9gagGAhmjzUJ+/DTyfzkt0XXxAWAP/Tlt46lAdyyBL1QyTG 94mbz+BTM5Tj/68OLIof4cPbtwZRe8o5pfMR3KA= X-Google-Smtp-Source: AMsMyM7g2YsaKgc547CoK4bbP7to7BKrdKl0htwACMTXkXuoifpxWjFr7Fm1X8QV4D/IKP9I7s1XAiq4g2VBs5hSObs= X-Received: by 2002:a05:6512:3d9f:b0:4a2:5bb4:d352 with SMTP id k31-20020a0565123d9f00b004a25bb4d352mr5863636lfv.314.1667233586009; Mon, 31 Oct 2022 09:26:26 -0700 (PDT) MIME-Version: 1.0 References: <20221031161256.199149-1-ammarfaizi2@gnuweeb.org> <20221031161256.199149-3-ammarfaizi2@gnuweeb.org> In-Reply-To: <20221031161256.199149-3-ammarfaizi2@gnuweeb.org> From: Alviro Iskandar Setiawan Date: Mon, 31 Oct 2022 23:26:14 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RESEND v3 2/2] daemon: telegram: Handle MySQL error To: Ammar Faizi Cc: "GNU/Weeb Mailing List" , Muhammad Rizki Content-Type: text/plain; charset="UTF-8" List-Id: On Mon, Oct 31, 2022 at 11:13 PM Ammar Faizi wrote: > A previous patch creates a mechanism to allow the caller to reconnect > to the database by calling db.connect(). Handle MySQL error in the > main daemon loop path. Do reconnect to the database if such an error > happens. This way, the daemon can automatically recover from the MySQL > server restart without having the user restart the daemon. > > v3: > - Simplify try and except statement (comment from Muhammad Rizki). > > v2: > * no changes * > > Signed-off-by: Ammar Faizi Reviewed-by: Alviro Iskandar Setiawan