From f54c78613e804de58b2376f7a6f3dd50b8235375 Mon Sep 17 00:00:00 2001 From: chacha <1000chacha0001@gmail.com> Date: Mon, 18 Jul 2022 19:13:45 +0000 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'ChaChaIPToCountryD?= =?UTF-8?q?aemon/core.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - get results in two times to save ram again --- ChaChaIPToCountryDaemon/core.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ChaChaIPToCountryDaemon/core.py b/ChaChaIPToCountryDaemon/core.py index 00a1b06..19e9600 100644 --- a/ChaChaIPToCountryDaemon/core.py +++ b/ChaChaIPToCountryDaemon/core.py @@ -288,6 +288,25 @@ class ChaChaIPToCountryStorage: task = loop.run_in_executor(_executor,processIPRangeList,_IPRange_percountry[key],key) tasksIPV6.append(task) print("IPV6 dataset (CSV) Started") + + print("Wait IPV4 parsing to complete (files)...") + results = await asyncio.gather(*tasksIPV4) + for _set,_entry_code in results: + if _entry_code not in _ipv4set: + _ipv4set[_entry_code] = IPSet_nocompact() + _ipv4set[_entry_code].update(_set) + _ipv4set[_entry_code].ForceCompact() + print("Done") + + if DEFAULT__EnableIPV6: + print("Wait IPV6 parsing to complete (files)...") + results = await asyncio.gather(*tasksIPV6) + for _set,_entry_code in results: + if _entry_code not in _ipv6set: + _ipv6set[_entry_code] = IPSet_nocompact() + _ipv6set[_entry_code].update(_set) + _ipv6set[_entry_code].ForceCompact() + print("Done") #Add private network at the end tasksIPV4.append( loop.run_in_executor(_executor,processIPRangeList,IPRange("192.168.0.0", "192.168.255.255"), "ZZ"))