This commit is contained in:
hsafaei
2025-06-18 15:46:57 +03:30
parent e4a92befb7
commit cec03b7d3b
11 changed files with 856 additions and 150 deletions
+12 -10
View File
@@ -140,10 +140,10 @@ def moveClassifierAiCodes(elastic, index_name_o, data):
list_bulk=[]
for item in data:
index += 1
# percent = int((index / len(data)) * 100)
# if percent != percent_prev:
# print("progress -> %.2f %%" % percent)
# percent_prev = percent
percent = int((index / len(data)) * 100)
if percent != percent_prev:
print("progress -> %.2f %%" % percent)
percent_prev = percent
id = item
best_code = data[item]['best-class']
@@ -164,12 +164,12 @@ def moveClassifierAiCodes(elastic, index_name_o, data):
if len(list_bulk) > 200 :
elastic.updateBulkList(list_bulk, index_name_o)
list_bulk = []
print(f"send_round -> {send_round}")
# print(f"send_round -> {send_round}")
send_round += 1
if len(list_bulk) :
elastic.updateBulkList(list_bulk, index_name_o)
print(f"last ::: send_round -> {send_round}")
# print(f"last ::: send_round -> {send_round}")
@@ -185,12 +185,15 @@ def moveClassifierAiCodes(elastic, index_name_o, data):
load_dotenv(dotenv_path='config.env')
host=os.getenv('HOST_160')
password=os.getenv('HOST_160_PASS')
# host=os.getenv('HOST_160')
# password=os.getenv('HOST_160_PASS')
# host=os.getenv('HOST_112')
# password=os.getenv('HOST_112_PASS')
host=os.getenv('HOST_113')
password=os.getenv('HOST_113_PASS')
# host=os.getenv('HOST_60')
# password=os.getenv('HOST_60_PASS')
@@ -198,8 +201,7 @@ password=os.getenv('HOST_160_PASS')
print(host)
# print(password)
# path_base_map = "G:/Project2/gateway2_main/repo/_other/"
path_base_map = ""
path_base_map = "G:/Project2/gateway2_main/repo/_other/"
elastic = ElasticHelper(host, password, "elastic", path_base_map)