File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,24 @@ async def lifespan(fastapi: FastAPI):
68
68
app = FastAPI (lifespan = lifespan )
69
69
70
70
71
+ def verify_json_file (file_path : str ) -> bool :
72
+ try :
73
+ with open (file_path , 'r' ) as f :
74
+ json .load (f )
75
+ except Exception :
76
+ return False
77
+ return True
78
+
79
+
71
80
def dbt_artifacts_updated_callback (file_changed_event : Any ):
72
81
src_path = Path (file_changed_event .src_path )
73
82
target_type = src_path .parent .name
74
83
file_name = src_path .name
84
+
85
+ if not verify_json_file (file_changed_event .src_path ):
86
+ logger .debug ('Skip to refresh the artifacts because the file is not updated completely.' )
87
+ return
88
+
75
89
logger .info (
76
90
f'Detect { target_type } file { file_changed_event .event_type } : { file_name } ' )
77
91
ctx = load_context ()
You can’t perform that action at this time.
0 commit comments