Signed-off-by: Corey Shields <cshields@gmail.com>
In django cache we are storing a full queryset of the satellites with their data count and last payload time. By trying to filter on this (sat_cache = sats_cache.filter(norad_cat_id=norad)) we cause django to re-evaluate the queries for that specific satellite. For CAS-4a this results in 2 queries that exceed 5 mins each.
This does not impact the /stats/ page as it iterates through the whole list of satellites in cache. This change mimics that behavior to find the satellite cache we care about in the template. Its a huge hack but its the only way we can show a count and bring the page view back for !237 quickly... This needs refactoring, big time..
I also pulled an unused has_telemetry_data which caused a db count
This leaves behind a query to pull the last payload to show who submitted the last payload, as without this query there is no connection between the cached satellite info and the actual observer (because the /stats/ page was not meant to make that connection). If this query continues to be prohibitive we may just need to remove the "last frame submitted by.." blob.
In this change we continue using the cache for the frame count, but instead of using the cache for the latest frame as discussed in IRC we grab the latest frame based on the ID. In my test environment this was a reasonable query time.
I'd rather we try this route before resorting to the cache for latest frame as it will be a better user experience.
Signed-off-by: Corey Shields <cshields@gmail.com>
This commit replaces the recursive 'dict' extraction functions with
'get_fields()' method which returns specific fields from Kaitai Struct
docstrings. The InfluxDB schema is also optimized to write multiple
fields per data point with the unique NORAD id used as the measurement
name.
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
Due to Celestrak returning the TLE of 00005 when asked for TLEs for
satellites with NORAD IDs in the 999xx range, satellites with
temporary NORAD IDs get assigned a wrong TLE.
This commit adds a workaround by skipping satellites with temporary
NORAD IDs when updating TLEs.
This makes static files and templates source paths relative to the
application instead of current working directory.
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>