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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01olkn2062.outbound.protection.outlook.com [40.92.52.62]) by gnuweeb.org (Postfix) with ESMTPS id 937C781666 for ; Sat, 26 Nov 2022 20:21:21 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=hotmail.com header.i=@hotmail.com header.a=rsa-sha256 header.s=selector1 header.b=fDutOM2S; dkim-atps=neutral ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gh1uW+7RA6xpbImPU5PMfV4w4e1JhEwzVEWlnoxE4UOG9fAQ6DG6EPK85ATluSKI3ZWCFPVO3ea6YGDd3N4UuoZBqZF2yqQZT629Mb0Dkmi+GTtSsBsot8JLfqSNS72BU5bw7eaTXsIDPm4xh8B6mNpDw+QVzWaK88pKIPWe7EjY8sH5ltOnwUciNuCkcTJ/G4zWg0rxScqss6A70sSfJyJDGY1Evak9pNGw/1dLDWH1EUSHid92YGWTLoj4SU0k9pLzbomG3EAqph7GapCLw+AKLJaWLVqerYBAGcPwcMYT087mpc61H5vA6jloQkX1HAD3WhcIYdMkvHMShYMfxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yvcm/QP6UgGvOw2/6zgrOE1QFs3b8kTrYy9g5QR/hpE=; b=fmMzI7QynUbXIxylwX27jrqio+u/diuoy04754KgY8H0MEiKhUW2DW8ARka88ijxHviEvnMPkyta2ykGkJVbbg91Y/lrhylZ5yNORxRBCUWkJ9fc0sxqkMWb1Kn3DBacFTqqRJnuBWloZAXltfhHzrmNDIe8HYS837VU/Q6m2veZ0BXYOY73N4MvL54feSn+u5gmHlprbRci3fj00pGWfPu+ZdRNwD35KH6wH1dpHh023F43tEvVUYLZnrIqtFt9S22CstWe/TCWTdJjRTBQ0b9RoguZR+VUglmv617bPOWITUZDP88gHPUnH84g4Mwg3LFWQxmuwubm9Id9vUG4qg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yvcm/QP6UgGvOw2/6zgrOE1QFs3b8kTrYy9g5QR/hpE=; b=fDutOM2ScQdiv+RdRi7X0Yh2wTupFGMzaZwQBDhBzrmhUI6PcOi+dXRQxjHRFANqtUBt3l0Ki1kYofoS93OgOKXiWSmdgMdyYV821wbGYB1JfPFIF/iurAC/lzbel2+NsxJ6sot1cgfxQAdyb78ZK5HOpC5wteWcivNRg66+Al7Wiq0Qj54XaPTNN/jBoDfCn1KuTph7D+yx+2eqQ9/bj14VxQKLEqYWDV+jFyjrQx6t9L3s4Q/MDh6eNybV0WY8ulo3u0tl4xuYPgo2X+dHNqJAD2vlySvCcBBVF75Z4gNdTUmtXfppnlzCq2CulSdajCElOgsXjnHS2LtagcQeyw== Received: from TY0PR06MB5427.apcprd06.prod.outlook.com (2603:1096:400:218::11) by SEZPR06MB5415.apcprd06.prod.outlook.com (2603:1096:101:66::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.22; Sat, 26 Nov 2022 20:21:18 +0000 Received: from TY0PR06MB5427.apcprd06.prod.outlook.com ([fe80::3f7b:8f03:f2cb:9b00]) by TY0PR06MB5427.apcprd06.prod.outlook.com ([fe80::3f7b:8f03:f2cb:9b00%9]) with mapi id 15.20.5857.021; Sat, 26 Nov 2022 20:21:17 +0000 From: Taufiq Pohan To: Ammar Faizi Cc: Taufiq Pohan , Aldy Prastyo , VNLX Kernel Department , GNU/Weeb Mailing List Subject: [PATCH v1] index: Fix wrong last id at initialization Date: Sun, 27 Nov 2022 03:21:07 +0700 Message-ID: X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [AauSAVwPswaWOjfSB5LxIuJQ9MKJbo7E] X-ClientProxiedBy: SI1PR02CA0011.apcprd02.prod.outlook.com (2603:1096:4:1f7::19) To TY0PR06MB5427.apcprd06.prod.outlook.com (2603:1096:400:218::11) X-Microsoft-Original-Message-ID: <20221126202107.296553-1-m.taufiq30s@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY0PR06MB5427:EE_|SEZPR06MB5415:EE_ X-MS-Office365-Filtering-Correlation-Id: 3948dc55-72fb-4b6e-1584-08dacfebc615 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKwYUw59ZxKZ0arsxuW3OwS9nLw70f9aGF+sxJkA1g9EBBjCz1g9+jjFBA/2Pi+a1x5MUa6KS/xduH3t/Jxy9I6LfB+IbhZnpeF18bgIIRjWcFMON7Z+oQVss2Q6m6u+lE5VieV+uo/2tQ/qLiGxUcwMUS9zBDcoSo882U00bVnvu6cMTT3ZLj/RD3zEJS+mU6jHT8u6kHofNVZ84uiy/uTLQSADE43o+4xi6QjSIOrJUpeB9ArKTHQaWZ7wPrPkiXWCu5fsunUNmeUSu/l6Lea9EQCv8x6FmzLtxKX+QqV17JKaXTrHcABLxIe3lxlkI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urkyAc9NGtSQwSGXsWUr+SSsg5lge/uclX76sGTW2s+sL3sAmFRPAi5nA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?44dvND5YNhyc6p0IzH/KVIX+fNOh3ml7VujdD4YfinS5cfTx9J08KryAwfkh?= =?us-ascii?Q?j4NhHf3YwmXb7sshCoFdkTvmspwPvVm6BCjarq496lta1F7FVkUwvDXAdpSZ?= =?us-ascii?Q?9FPVdX2LlsXILj1l5d4ssBFBixct2sK9UV7H/1A+TpLgBbKOCIKsp8QYvRqd?= =?us-ascii?Q?FGFib0wxmy84MVwTIODDHXLCBGqTu2wJTXQ/cEs3xpoj2xVQXFxy6MS0gWNz?= =?us-ascii?Q?vvRRLaU1PhFfCPDFE2purCormwlHa5lJPCdqHOfY15UFFKAP3aizkI2AUFP7?= =?us-ascii?Q?FKwv6vSHybiemK41Ch/K6QwO1oMS3Gq/tsekr2I9qjhu0oGeYhTdU/Xgh3sk?= =?us-ascii?Q?QJu7pu3CXKx+lq0nNejApp2D3UUT8pLZZeGv5m3swOSsJVBNyTiwj8EuH3Uo?= =?us-ascii?Q?NIA+zmWWvq7Uk/HdZbkUBCTyMLISmGsfB7L4MGw/0JHc7yDKjcoGkeoKzBov?= =?us-ascii?Q?oAscU32xwiog+axcOJhxsJsUdD7tVShiMtCY6xdvisWOb5gNijR3KcfMKo6E?= =?us-ascii?Q?XxMNNQyjil5UtFkvezM00xGjtFH/akZset3qJWzpBc3w/bkVUAQfqg3uJSvE?= =?us-ascii?Q?of7K7WGGH3jIDSnuE/XUFsWuSuyDJ75EjGS5t824aKPWK2iu9KnGGQHBzrA5?= =?us-ascii?Q?DQrjwqvIhHKFHQVFOIoFOu2jxGmMmIQqXEPsON2v1fwaDnYO0/hMSlU2GhAd?= =?us-ascii?Q?5XKsVZG7ZJLMDjPy13w75cbu1JpSDXjvjC5Y6e/MWvoqGqo7DmzSMMP8nwef?= =?us-ascii?Q?lxcrAsAo8QuDxRQnzgrdPDrVX3QshtHVbp1QIZUr6QOBiMzFhtUoPlAbnw4R?= =?us-ascii?Q?4QHW/TD2KT0rnfktB2j/TOp5YGo5P4ikSb64vE5EPPnnkvXweBgABaFtZvvh?= =?us-ascii?Q?PQh3J8d5LtjqeHMBv0DbIQtgkJnBxATiiKRwtTq999TQQbLYtXLfbzs23gPM?= =?us-ascii?Q?oZgcozDGa7ZsCn1zNocNde0IhupPH0SEJCimh4y039d19h2ea+D7ITf7m7EO?= =?us-ascii?Q?HzGm6h9dW4G4+o/SDS5QF/hvpzfVjGHhkn8GZA42QU+BKcRNCYvhwo6+C4tn?= =?us-ascii?Q?ZHkIwmQtylr52DW20Owu0IJyBL18wAEsp0pcgW3p32DnZ4+oNdCVJp1oxDiu?= =?us-ascii?Q?4Yzj5bqnt1sDDYR+8oCsZIV5ZIUM67DL8A5jtq3TPpqs7I4F1+Ei5+2csSIW?= =?us-ascii?Q?wlbE31RabCDBwk40R+IzA30S+gMMdrOML1Z7DkMW6nVR0it1F+J77Mb21TU8?= =?us-ascii?Q?HeBbXAwmUhzNheJ79+0Dx7nVHqu9y7XjigSecFGyNQ=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-3208f.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 3948dc55-72fb-4b6e-1584-08dacfebc615 X-MS-Exchange-CrossTenant-AuthSource: TY0PR06MB5427.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2022 20:21:17.7005 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5415 List-Id: In main function, the return from get_last_id is added by 1. Therefore if we dont have vn-stats.json, the id will start from 2 because get_last_id will return 1. Signed-off-by: Taufiq Pohan --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 513ffad..0d935dc 100644 --- a/index.js +++ b/index.js @@ -71,12 +71,12 @@ function save_last_id(id) function get_last_id() { if (!fs.existsSync('./vn-stats.json')) - return 1; + return 0; const jsonVal = fs.readFileSync('./vn-stats.json'); let ret = JSON.parse(jsonVal); if (!("last_vn_id" in ret) || isNaN(ret.last_vn_id)) - return 1; + return 0; return ret.last_vn_id } base-commit: 6f43eec419f11a4850c36ec8a046a0425e38b1a2 -- Taufiq Pohan