File tree Expand file tree Collapse file tree 3 files changed +0
-45
lines changed Expand file tree Collapse file tree 3 files changed +0
-45
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
- import threading
3
2
import warnings
4
- from functools import wraps
5
3
6
4
from django .db import transaction
7
5
from django .db .utils import DatabaseError , OperationalError , ProgrammingError
8
6
from netbox .plugins import PluginConfig
9
7
10
8
from .constants import APP_LABEL as APP_LABEL
11
9
12
- # Global lock for plugin ready method
13
- _plugin_ready_lock = threading .RLock ()
14
-
15
-
16
- def thread_safe_plugin_ready (func ):
17
- """
18
- Decorator to ensure thread-safe plugin ready method execution.
19
- """
20
- @wraps (func )
21
- def wrapper (self , * args , ** kwargs ):
22
- with _plugin_ready_lock :
23
- return func (self , * args , ** kwargs )
24
- return wrapper
25
-
26
10
27
11
def is_running_migration ():
28
12
"""
@@ -67,7 +51,6 @@ class CustomObjectsPluginConfig(PluginConfig):
67
51
required_settings = []
68
52
template_extensions = "template_content.template_extensions"
69
53
70
- @thread_safe_plugin_ready
71
54
def ready (self ):
72
55
from .models import CustomObjectType
73
56
from netbox_custom_objects .api .serializers import get_serializer_class
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 51
51
from utilities .validators import validate_regex
52
52
53
53
from netbox_custom_objects .constants import APP_LABEL , RESERVED_FIELD_NAMES
54
- from netbox_custom_objects .decorators import thread_safe_model_generation
55
54
from netbox_custom_objects .field_types import FIELD_TYPE_CLASS
56
55
from netbox_custom_objects .utilities import generate_model
57
56
@@ -444,7 +443,6 @@ def register_custom_object_search_index(self, model):
444
443
label = f"{ APP_LABEL } .{ self .get_table_model_name (self .id ).lower ()} "
445
444
registry ["search" ][label ] = search_index
446
445
447
- @thread_safe_model_generation
448
446
def get_model (
449
447
self ,
450
448
skip_object_fields = False ,
@@ -550,7 +548,6 @@ def wrapped_post_through_setup(self, cls):
550
548
551
549
return model
552
550
553
- @thread_safe_model_generation
554
551
def get_model_with_serializer (self ):
555
552
from netbox_custom_objects .api .serializers import get_serializer_class
556
553
model = self .get_model ()
You can’t perform that action at this time.
0 commit comments