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 localhost.localdomain (unknown [101.128.125.94]) by gnuweeb.org (Postfix) with ESMTPSA id 4F60D8076C; Fri, 29 Jul 2022 01:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1659058902; bh=dDn86D+dWE+qL7Sd46C9E+7lu4mY+IiZGBf3AoDKVWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9AsOuvhQguCL14U8C7QynDcXBi1oAP+qsbSSCMW+NC5YLAcirkhbFVsxgH7dwH0V SLAVb5W9B1ivifzfzqbKYXPTVDXYX3Vn0JoLCccWoRj76XP9uY3M8ycFO52AOK+8mn 3NHsYChyLig3xTAOLx+YRctI6mTe3JX37KvPlEOMBn+OnUaHfCNgLbrU0wxU+DssPT 4Du7fc1HH4/XtzohtIns8JZsVcmhXagPHKohNUy8wOo+GYblcq+UMI69yiOHSe9m8P IbDfYzw2+GqvpGPHPKjhCQU2fD4Eh5J4MFmHokrtlv+doOxpb8w9GHQz4idj36wqxw PhxylGrMhLa3Q== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List , Alviro Iskandar Setiawan Subject: [PATCH v3 03/18] Fix MySQL InternalError: Unread result found Date: Fri, 29 Jul 2022 08:40:37 +0700 Message-Id: <20220729014052.1547-4-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220729014052.1547-1-kiizuha@gnuweeb.org> References: <20220729014052.1547-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Use con.cursor(buffered=True) to make it avoid from mysql.connector.errors.InternalError: Unread result found. Signed-off-by: Muhammad Rizki --- daemon/scraper/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/scraper/db.py b/daemon/scraper/db.py index 321661f..296559e 100644 --- a/daemon/scraper/db.py +++ b/daemon/scraper/db.py @@ -12,7 +12,7 @@ class Db(): def __init__(self, conn): self.conn = conn self.conn.autocommit = True - self.cur = self.conn.cursor() + self.cur = self.conn.cursor(buffered=True) def __del__(self): -- Muhammad Rizki