Skip to content

Commit a62d03f

Browse files
committed
fix(main.py): Reset kcidb flags on node update
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]>
1 parent 690480c commit a62d03f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

api/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,15 @@ async def put_node(node_id: str, node: Node,
737737
status_code=status.HTTP_400_BAD_REQUEST,
738738
detail=message
739739
)
740+
741+
# KCIDB flags are reset on any update, because this means we need
742+
# to reprocess updated node.
743+
# So reset flag, unless flag is changed in the request
744+
old_flag = node_from_id.processed_by_kcidb_bridge
745+
new_flag = node.processed_by_kcidb_bridge
746+
if old_flag == new_flag:
747+
new_node_def.processed_by_kcidb_bridge = False
748+
740749
# Now we can update the state
741750
new_node_def.state = node.state
742751

0 commit comments

Comments
 (0)