File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,14 @@ RUN pip install --no-cache-dir -r /requirements.txt
15
15
COPY . .
16
16
17
17
RUN mkdir /app/static \
18
- /app/static/raw_data \
19
- /app/static/raw_data/current \
20
- /app/static/output \
21
- /app/static/output/reports \
22
- /app/static/logs \
23
- /app/static/zipped
18
+ /app/static/raw_data \
19
+ /app/static/raw_data/current \
20
+ /app/static/output \
21
+ /app/static/output/reports \
22
+ /app/static/logs \
23
+ /app/static/zipped
24
+
25
+ RUN [ ! -f /app/static/logs/last_execution.json ] && printf null > /app/static/logs/last_execution.json
24
26
25
27
RUN chmod -R 777 /app/static
26
28
Original file line number Diff line number Diff line change @@ -118,8 +118,19 @@ def listStatistics():
118
118
last_execution_details = json .loads (last_execution_file .read ())
119
119
last_execution_file .close ()
120
120
121
+ except (FileNotFoundError ):
122
+ current_app .logger .error ("last_execution.json file was missing" )
123
+ return abort (500 )
124
+
125
+ except (json .JSONDecodeError ):
126
+ current_app .logger .error (
127
+ "last_execution.json could not be decoded - possible corruption"
128
+ )
129
+ return abort (500 )
130
+
121
131
except Exception as e :
122
- return jsonify (None )
132
+ current_app .logger .error ("Failure reading last_execution.json: " , e )
133
+ return abort (500 )
123
134
124
135
return jsonify (last_execution_details )
125
136
You can’t perform that action at this time.
0 commit comments