chenhaiyang преди 4 години
родител
ревизия
739f76ae48
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      app/services/platform.py

+ 2 - 2
app/services/platform.py

@@ -64,7 +64,7 @@ class DataPlatformService(Service):
             if arrow.get(latest_time, TIME_FMT).shift(minutes=15) < arrow.get(self._now_time, TIME_FMT):
                 logger.info(f'delayed data - {object_id}: ({latest_time}, {latest_data})')
             value = round_half_up(latest_data, 2)
-        except KeyError and IndexError:
+        except KeyError and IndexError and TypeError:
             value = np.NAN
 
         return value
@@ -99,7 +99,7 @@ class DataPlatformService(Service):
             if arrow.get(latest_time, TIME_FMT).shift(minutes=15) < arrow.get(end_time, TIME_FMT):
                 logger.info(f'delayed data - {object_id}: ({latest_time}, {latest_data})')
             value = round_half_up(latest_data, 2)
-        except KeyError and IndexError:
+        except KeyError and IndexError and TypeError:
             value = np.NAN
 
         return value