fully implement location TTL functionality

This commit is contained in:
Jakob Ketterl 2023-08-26 16:23:03 +02:00
parent b2ddb8f3bb
commit 25947ac177
3 changed files with 31 additions and 8 deletions

View file

@ -152,6 +152,7 @@ $(function(){
position: pos,
title: sourceToString(update.source)
}, aprsOptions, getMarkerOpacityOptions(update.lastseen) ));
marker.source = update.source;
marker.lastseen = update.lastseen;
marker.mode = update.mode;
marker.band = update.band;
@ -520,7 +521,7 @@ $(function(){
});
Object.values(markers).forEach(function(m) {
var age = now - m.lastseen;
if (age > retention_time) {
if (age > retention_time || (m.ttl && age > m.ttl)) {
delete markers[sourceToKey(m.source)];
m.setMap();
return;