Skip to content

Commit

Permalink
fix(main.py): Reset kcidb flags on node update
Browse files Browse the repository at this point in the history
If node updated, this means it is node with new data, that
needs to be reprocessed by kcidb again, thus we need to reset
flag!

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Dec 4, 2024
1 parent 690480c commit a62d03f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,15 @@ async def put_node(node_id: str, node: Node,
status_code=status.HTTP_400_BAD_REQUEST,
detail=message
)

# KCIDB flags are reset on any update, because this means we need
# to reprocess updated node.
# So reset flag, unless flag is changed in the request
old_flag = node_from_id.processed_by_kcidb_bridge
new_flag = node.processed_by_kcidb_bridge
if old_flag == new_flag:
new_node_def.processed_by_kcidb_bridge = False

# Now we can update the state
new_node_def.state = node.state

Expand Down

0 comments on commit a62d03f

Please sign in to comment.