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 [172.16.0.2] (unknown [104.28.213.130]) by gnuweeb.org (Postfix) with ESMTPSA id 4C0C98093B; Mon, 3 Oct 2022 23:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664839882; bh=/OMRVih9EE1lUUJzBba0ydCya2E3ihlfTPLWQXtJcBY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Svpmvu8Jkk00Mm6i8z3iPHJQq7w1NlvtKUqLQRkoL+lDf5DMoEoAmwdPSSWg5jJ0o 2RMUJE+uw/TvRgSAQvhUH2RamNk8MVGVZZjPwMr1IRERYdSI7UahhgdxKJU82yD1PS Usu7qDZdmnG7DknOvOJuKPmqlJ6Hs8JhMRenaF9wQ/0uNinp2aeMoNBjjQv+58jhGp ddSjvdkRfcmO8Efz3UJREadxbjp3Bfv06LKMBEPEvyrFE3ZguFJii76YOWRwu/CmS8 0/L5kLIVe4LqYJlH/hGIPYgBHSYlkdlDmD7upOMDg86/Od1EI8VY269X+dYR5wG/xJ +noRquvjmfJkg== Message-ID: Date: Tue, 4 Oct 2022 06:31:17 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 00/26] The complete version of the Discord bot Content-Language: en-US To: Alviro Iskandar Setiawan , Muhammad Rizki Cc: GNU/Weeb Mailing List References: <20221001130355.784-1-kiizuha@gnuweeb.org> <7c6e2632-b8b2-a7dd-f972-07b2b864c20a@gnuweeb.org> <611e7213-ab87-1d72-7cf2-ca465067a89c@gnuweeb.org> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 10/4/22 6:22 AM, Alviro Iskandar Setiawan wrote: > On Tue, Oct 4, 2022 at 6:18 AM Muhammad Rizki wrote: >> On 04/10/2022 06.12, Alviro Iskandar Setiawan wrote: >>> On Mon, Oct 3, 2022 at 7:48 PM Ammar Faizi wrote: >>>> Files are not deleted: >>>> >>>> ammarfaizi2@integral2:~/app/lore-daemon.dev/daemon$ ls dscord/storage -l >>>> total 0 >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 78 Sep 3 17:25 23035eeb480f2b3501ba0841ef10ce3f >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 12 Oct 3 19:42 6766c45fa800d71173893158b2c7d640 >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:22 78380c23529749c280e4cca46f7519c9 >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:23 a23e986acc2c75d08a3e98377f06bbfe >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 356 Sep 3 17:22 b241bd7c932c70e6a81d107da019cb67 >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 12 Sep 3 17:25 bcaac8364eaf04951d504faa1f1df826 >>>> drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:23 c36cdede05b536d395c5b55dbae92288 >>>> ammarfaizi2@integral2:~/app/lore-daemon.dev/daemon$ >>> >>> bang, only 1 file from 3rd Oct, the rest are all old files from a >>> month ago, look at the date >>> >> >> Yes, this issue has already been a long time not fixed, because, in the >> past, I still don't know what caused it. Now, I think I see the problem. >> I've patched it and tested it. Wait until I send new PATCH email, thanks. > > the error Ammar reported could be the reason why the files are not > deleted, because if you hit an error, the code next to it won't be > executed, for ex: > > aaa() # error here > bbb() # this doesn't get executed > > you must use finally to handle this: > > try: > aaa() # error here > execpt: > pass > finally: > bbb() # it always gets executed > > but idk, i didn't investigate, just speculate I think we should fix the error in the first place. But I am fine with this cleanup strategy if you have addressed the error. I honestly don't like this approach, much better using some kind of return value check and goto just like I usually do in C. But we are not talking about C, so let's take the Python try+finally approach. -- Ammar Faizi