prevent future uploads

This commit is contained in:
xss 2023-06-13 10:23:46 +10:00
parent 77c81dbe73
commit f71dbde125
2 changed files with 4 additions and 1 deletions

View File

@ -228,6 +228,9 @@ def telemetry_filter(telemetry):
return (False, f"Unable to parse time")
sonde_time_threshold = 48
future_time_threshold_seconds = 60
if _delta_time < -future_time_threshold_seconds:
return (False, f"Sonde reported time too far in the future. Either sonde time or system time is invalid. (Threshold: {future_time_threshold_seconds} seconds)")
if abs(_delta_time) > (3600 * sonde_time_threshold):
return (False, f"Sonde reported time too far from current UTC time. Either sonde time or system time is invalid. (Threshold: {sonde_time_threshold} hours)")

View File

@ -11,7 +11,7 @@ body = [{
"uploader_position": [53.23764, 7.74426, 7.0],
"uploader_antenna": "5/8-Wave-J-Pole",
"time_received": "2023-01-22T22:48:43.208780Z",
"datetime": "2023-01-22T22:48:41.000000Z",
"datetime": "2023-06-13T00:48:41.000000Z",
"manufacturer": "Vaisala",
"type": "RS41",
"serial": "U1440085",