File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ def update_all_forecast_latest(forecasts: List[ForecastSQL], session: Session):
116
116
"""
117
117
118
118
# get all latest forecasts
119
+ logger .debug ('Getting all latest forecasts' )
119
120
forecasts_historic_all_gsps = get_latest_forecast_for_gsps (
120
121
session = session , historic = True , preload_children = True
121
122
)
@@ -124,16 +125,21 @@ def update_all_forecast_latest(forecasts: List[ForecastSQL], session: Session):
124
125
125
126
# chose the correct forecast historic
126
127
gsp_id = forecast .location .gsp_id
128
+ logger .debug (f'Updating forecast for gsp_id { gsp_id } ' )
129
+
127
130
forecast_historic = [
128
131
forecast_historic_one_gsps
129
132
for forecast_historic_one_gsps in forecasts_historic_all_gsps
130
133
if forecast_historic_one_gsps .location .gsp_id == gsp_id
131
134
]
132
135
if len (forecast_historic ) == 0 :
133
136
forecast_historic = None
137
+ logger .debug (f'Could not find historic, so will be creating one (GSP id{ gsp_id } )' )
134
138
else :
135
139
forecast_historic = forecast_historic [0 ]
136
140
141
+ logger .debug (f'Found historic for GSP id { gsp_id } ' )
142
+
137
143
update_forecast_latest (
138
144
forecast = forecast , session = session , forecast_historic = forecast_historic
139
145
)
You can’t perform that action at this time.
0 commit comments