Skip to content

Commit

Permalink
Merge pull request #113 from MikroElektronika/fix/index-required-pack…
Browse files Browse the repository at this point in the history
…ages

Finished and tested fix
  • Loading branch information
StrahinjaJacimovic authored Oct 14, 2024
2 parents 9f05ab1 + 66b9eb8 commit b8ac4de
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,14 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai
'schemas',
'images',
'preinit',
'database'
'database',
'database_dev'
]

if update_database:
if name_without_extension not in always_index:
continue

doc = None
if name_without_extension == "clocks":
current_hash, index_hash, check_version, new_version, existed = check_version_and_hash(es, index_name, asset['url'], token, 'clocks', True)
Expand Down Expand Up @@ -373,9 +378,9 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai

# Index the document
if doc:
if re.search(r'^.+\.(json|7z)$', asset['name']) and (update_package or force):
if re.search(r'^.+\.(json|7z)$', asset['name']) and (update_package or force or (name_without_extension in always_index)):
if update_database:
if ('database' == package_name):
if name_without_extension in always_index:
resp = es.index(index=index_name, doc_type='necto_package', id=name_without_extension, body=doc)
print(f"{resp["result"]} {resp['_id']}")
else:
Expand Down

0 comments on commit b8ac4de

Please sign in to comment.