@@ -64,17 +64,18 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai
64
64
'hidden' : False ,
65
65
'type' : 'legacy_sdk' ,
66
66
'version' : version ,
67
- 'created_at' : asset ['created_at' ],
68
- 'updated_at' : asset ['updated_at' ],
67
+ 'created_at' : asset ['created_at' ],
68
+ 'updated_at' : asset ['updated_at' ],
69
69
'category' : 'Software Development Kit' ,
70
70
'download_link' : asset ['url' ], # Adjust as needed for actual URL
71
- 'install_location' : f"%APPLICATION_DATA_DIR%/packages/legacy/{ name_without_extension .lower ()} " ,
72
- 'package_changed' : True
71
+ 'install_location' : f"%APPLICATION_DATA_DIR%/packages/legacy/{ name_without_extension .lower ()} " ,
72
+ 'package_changed' : True ,
73
+ 'gh_package_name' : f"{ name_without_extension } .7z"
73
74
}
74
75
75
76
# Index the document
76
77
if doc :
77
- resp = es .index (index = index_name , doc_type = 'necto_package' , id = name_without_extension , body = doc )
78
+ resp = es .index (index = index_name , doc_type = None , id = name_without_extension , body = doc )
78
79
print (f"{ resp ["result" ]} { resp ['_id' ]} " )
79
80
80
81
if __name__ == '__main__' :
@@ -87,18 +88,19 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai
87
88
88
89
# Elasticsearch instance used for indexing
89
90
num_of_retries = 1
91
+ print ("Trying to connect to ES" )
90
92
while True :
91
- print (f"Trying to connect to ES. Connection retry: { num_of_retries } " )
92
93
es = Elasticsearch ([os .environ ['ES_HOST' ]], http_auth = (os .environ ['ES_USER' ], os .environ ['ES_PASSWORD' ]))
93
94
if es .ping ():
94
95
break
95
- # Wait for 30 seconds and try again if connection fails
96
+ # Wait 1 second and try again if connection fails
96
97
if 10 == num_of_retries :
97
98
# Exit if it fails 10 times, something is wrong with the server
98
99
raise ValueError ("Connection to ES failed!" )
100
+ print (f"Connection retry: { num_of_retries } " )
99
101
num_of_retries += 1
100
102
101
- time .sleep (30 )
103
+ time .sleep (1 )
102
104
103
105
# Now index the new release
104
106
index_release_to_elasticsearch (
0 commit comments