1
This commit is contained in:
+12
-10
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user