File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def check_refresh(self) -> bool:
156
156
whether a refresh of the CO2 intensity was requested
157
157
from the CO2 Signal API.
158
158
"""
159
- if not self . co2_intensity and (
159
+ if (
160
160
not self ._local_data .setdefault (self ._client .country_code , {})
161
161
or self .outdated
162
162
):
@@ -193,12 +193,11 @@ def estimate_co2_emissions(
193
193
if not (_process := self ._processes .get (process_id )):
194
194
self ._processes [process_id ] = (_process := ProcessData ())
195
195
196
- self .check_refresh ()
197
-
198
196
if self .co2_intensity :
199
197
_current_co2_intensity = self .co2_intensity
200
198
_co2_units = "kgCO2/kWh"
201
199
else :
200
+ self .check_refresh ()
202
201
self ._current_co2_data = CO2SignalResponse (
203
202
** self ._local_data [self ._client .country_code ]
204
203
)
You can’t perform that action at this time.
0 commit comments