forked from p34709852/monkey
parent
174392848f
commit
28f60d51ff
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import threading
|
||||
from typing import Dict, List
|
||||
|
||||
from bson import ObjectId
|
||||
|
@ -10,6 +11,8 @@ from monkey_island.cc.models.edge import Edge
|
|||
|
||||
RIGHT_ARROW = "\u2192"
|
||||
|
||||
lock = threading.Lock()
|
||||
|
||||
|
||||
class EdgeService(Edge):
|
||||
@staticmethod
|
||||
|
@ -18,6 +21,7 @@ class EdgeService(Edge):
|
|||
|
||||
@staticmethod
|
||||
def get_or_create_edge(src_node_id, dst_node_id, src_label, dst_label) -> EdgeService:
|
||||
with lock:
|
||||
edge = None
|
||||
try:
|
||||
edge = EdgeService.objects.get(src_node_id=src_node_id, dst_node_id=dst_node_id)
|
||||
|
|
Loading…
Reference in New Issue