Skip to content

Commit

Permalink
corrected timestamp in fix proposal store
Browse files Browse the repository at this point in the history
  • Loading branch information
Eleanor Smith committed Jun 17, 2021
1 parent 7e2e14b commit ad4459f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dachar/fixes/fix_proposal_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _update_fix_container(self, container, fix, status, reason=""):
0,
{
"status": container["status"],
"timestamp": container["timestamp"],
"timestamp": now_string(),
"reason": container["reason"],
},
)
Expand Down
17 changes: 12 additions & 5 deletions dachar/utils/create_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,23 @@ def clone_index_and_update_alias(index_name, date, index_to_clone):
clone an index and update the alias to point to the new index
"""

exists = es.indices.exists(f"{name}-{date}")
exists = es.indices.exists(f"{index_name}-{date}")
if not exists:
es.indices.clone(index_to_clone, f"{name}-{date}")
alias_exists = es.indices.exists_alias(name=f"{name}", index=f"{name}-{date}")
es.indices.clone(index_to_clone, f"{index_name}-{date}")
alias_exists = es.indices.exists_alias(
name=f"{index_name}", index=f"{index_name}-{date}"
)
if not alias_exists:
es.indices.update_aliases(
body={
"actions": [
{"remove": {"alias": f"{name}", "index": "*"}},
{"add": {"alias": f"{name}", "index": f"{name}-{date}"}},
{"remove": {"alias": f"{index_name}", "index": "*"}},
{
"add": {
"alias": f"{index_name}",
"index": f"{index_name}-{date}",
}
},
]
}
)
Expand Down

0 comments on commit ad4459f

Please sign in to comment.