File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ def validate(self, data: dict) -> dict:
61
61
return data
62
62
63
63
def synthetic_create (self , reason : str , * args : Any , ** kwargs : Any ) -> ExportedAsset :
64
- return self ._create_asset (self .validated_data , user = None , reason = reason )
64
+ # force_async here to avoid blocking patches to the /sharing endpoint
65
+ return self ._create_asset (self .validated_data , user = None , reason = reason , force_async = True )
65
66
66
67
def create (self , validated_data : dict , * args : Any , ** kwargs : Any ) -> ExportedAsset :
67
68
request = self .context ["request" ]
@@ -72,6 +73,7 @@ def _create_asset(
72
73
validated_data : dict ,
73
74
user : User | None ,
74
75
reason : str | None ,
76
+ force_async : bool = False ,
75
77
) -> ExportedAsset :
76
78
if user is not None :
77
79
validated_data ["created_by" ] = user
@@ -103,7 +105,7 @@ def _create_asset(
103
105
only_evaluate_locally = False ,
104
106
send_feature_flag_events = False ,
105
107
)
106
- if blocking_exports :
108
+ if blocking_exports and not force_async :
107
109
exporter .export_asset (instance .id )
108
110
else :
109
111
exporter .export_asset .delay (instance .id )
You can’t perform that action at this time.
0 commit comments