@@ -189,11 +189,13 @@ def handle_find_minimal_covering_nodes(table_id, is_binary=True):
189189 ): # Process from higher layers to lower layers
190190 if len (node_queue [layer ]) == 0 :
191191 continue
192-
192+
193193 current_nodes = list (node_queue [layer ])
194194
195195 # Call handle_roots to find parents
196- parents = cg .get_roots (current_nodes , stop_layer = layer + 1 , time_stamp = timestamp )
196+ parents = cg .get_roots (
197+ current_nodes , stop_layer = layer + 1 , time_stamp = timestamp
198+ )
197199 unique_parents = np .unique (parents )
198200 parent_layers = np .array (
199201 [cg .get_chunk_layer (parent ) for parent in unique_parents ]
@@ -312,7 +314,11 @@ def str2bool(v):
312314
313315
314316def publish_edit (
315- table_id : str , user_id : str , result : GraphEditOperation .Result , is_priority = True
317+ table_id : str ,
318+ user_id : str ,
319+ result : GraphEditOperation .Result ,
320+ is_priority = True ,
321+ remesh : bool = True ,
316322):
317323 import pickle
318324
@@ -322,6 +328,7 @@ def publish_edit(
322328 "table_id" : table_id ,
323329 "user_id" : user_id ,
324330 "remesh_priority" : "true" if is_priority else "false" ,
331+ "remesh" : "true" if remesh else "false" ,
325332 }
326333 payload = {
327334 "operation_id" : int (result .operation_id ),
@@ -343,6 +350,7 @@ def handle_merge(table_id, allow_same_segment_merge=False):
343350
344351 nodes = json .loads (request .data )
345352 is_priority = request .args .get ("priority" , True , type = str2bool )
353+ remesh = request .args .get ("remesh" , True , type = str2bool )
346354 chebyshev_distance = request .args .get ("chebyshev_distance" , 3 , type = int )
347355
348356 current_app .logger .debug (nodes )
@@ -391,7 +399,7 @@ def handle_merge(table_id, allow_same_segment_merge=False):
391399 current_app .logger .debug (("lvl2_nodes:" , ret .new_lvl2_ids ))
392400
393401 if len (ret .new_lvl2_ids ) > 0 :
394- publish_edit (table_id , user_id , ret , is_priority = is_priority )
402+ publish_edit (table_id , user_id , ret , is_priority = is_priority , remesh = remesh )
395403
396404 return ret
397405
@@ -405,6 +413,7 @@ def handle_split(table_id):
405413
406414 data = json .loads (request .data )
407415 is_priority = request .args .get ("priority" , True , type = str2bool )
416+ remesh = request .args .get ("remesh" , True , type = str2bool )
408417 mincut = request .args .get ("mincut" , True , type = str2bool )
409418
410419 current_app .logger .debug (data )
@@ -457,7 +466,7 @@ def handle_split(table_id):
457466 current_app .logger .debug (("lvl2_nodes:" , ret .new_lvl2_ids ))
458467
459468 if len (ret .new_lvl2_ids ) > 0 :
460- publish_edit (table_id , user_id , ret , is_priority = is_priority )
469+ publish_edit (table_id , user_id , ret , is_priority = is_priority , remesh = remesh )
461470
462471 return ret
463472
@@ -470,6 +479,7 @@ def handle_undo(table_id):
470479
471480 data = json .loads (request .data )
472481 is_priority = request .args .get ("priority" , True , type = str2bool )
482+ remesh = request .args .get ("remesh" , True , type = str2bool )
473483 user_id = str (g .auth_user .get ("id" , current_app .user_id ))
474484
475485 current_app .logger .debug (data )
@@ -489,7 +499,7 @@ def handle_undo(table_id):
489499 current_app .logger .debug (("lvl2_nodes:" , ret .new_lvl2_ids ))
490500
491501 if ret .new_lvl2_ids .size > 0 :
492- publish_edit (table_id , user_id , ret , is_priority = is_priority )
502+ publish_edit (table_id , user_id , ret , is_priority = is_priority , remesh = remesh )
493503
494504 return ret
495505
@@ -502,6 +512,7 @@ def handle_redo(table_id):
502512
503513 data = json .loads (request .data )
504514 is_priority = request .args .get ("priority" , True , type = str2bool )
515+ remesh = request .args .get ("remesh" , True , type = str2bool )
505516 user_id = str (g .auth_user .get ("id" , current_app .user_id ))
506517
507518 current_app .logger .debug (data )
@@ -521,7 +532,7 @@ def handle_redo(table_id):
521532 current_app .logger .debug (("lvl2_nodes:" , ret .new_lvl2_ids ))
522533
523534 if ret .new_lvl2_ids .size > 0 :
524- publish_edit (table_id , user_id , ret , is_priority = is_priority )
535+ publish_edit (table_id , user_id , ret , is_priority = is_priority , remesh = remesh )
525536
526537 return ret
527538
@@ -536,6 +547,7 @@ def handle_rollback(table_id):
536547 target_user_id = request .args ["user_id" ]
537548
538549 is_priority = request .args .get ("priority" , True , type = str2bool )
550+ remesh = request .args .get ("remesh" , True , type = str2bool )
539551 skip_operation_ids = np .array (
540552 json .loads (request .args .get ("skip_operation_ids" , "[]" )), dtype = np .uint64
541553 )
@@ -562,7 +574,7 @@ def handle_rollback(table_id):
562574 raise cg_exceptions .BadRequest (str (e ))
563575
564576 if ret .new_lvl2_ids .size > 0 :
565- publish_edit (table_id , user_id , ret , is_priority = is_priority )
577+ publish_edit (table_id , user_id , ret , is_priority = is_priority , remesh = remesh )
566578
567579 return user_operations
568580
0 commit comments