Reduce API load: fewer frames, 10min refresh, 5s startup delay
This commit is contained in:
@@ -30,13 +30,16 @@ Module.register("MMM-CombinedMap", {
|
|||||||
radarOpacity: 0.7,
|
radarOpacity: 0.7,
|
||||||
trafficOpacity: 0.7,
|
trafficOpacity: 0.7,
|
||||||
|
|
||||||
// Radar frames
|
// Radar frames (reduced to limit API load)
|
||||||
historyFrames: 12, // 1 hour of history (5 min intervals)
|
historyFrames: 6, // 30 min of history (5 min intervals)
|
||||||
forecastFrames: 24, // 2 hours of forecast
|
forecastFrames: 12, // 1 hour of forecast
|
||||||
extraDelayLastFrame: 2000, // Extra delay on last frame
|
extraDelayLastFrame: 2000, // Extra delay on last frame
|
||||||
|
|
||||||
// Update interval (ms) - how often to refresh radar data
|
// Update interval (ms) - how often to refresh radar data
|
||||||
updateInterval: 5 * 60 * 1000, // 5 minutes
|
updateInterval: 10 * 60 * 1000, // 10 minutes
|
||||||
|
|
||||||
|
// Startup delay to avoid hammering API on restarts
|
||||||
|
startupDelay: 5000, // 5 seconds
|
||||||
},
|
},
|
||||||
|
|
||||||
getStyles: function() {
|
getStyles: function() {
|
||||||
@@ -121,9 +124,9 @@ Module.register("MMM-CombinedMap", {
|
|||||||
this.addTrafficLayer();
|
this.addTrafficLayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Radar layer (DWD)
|
// Radar layer (DWD) - delayed start to avoid API hammering
|
||||||
if (this.config.showRadar) {
|
if (this.config.showRadar) {
|
||||||
this.fetchRadarCapabilities();
|
setTimeout(() => this.fetchRadarCapabilities(), this.config.startupDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marker
|
// Marker
|
||||||
@@ -435,11 +438,11 @@ Module.register("MMM-CombinedMap", {
|
|||||||
// Labels for start/end
|
// Labels for start/end
|
||||||
const startLabel = document.createElement("div");
|
const startLabel = document.createElement("div");
|
||||||
startLabel.className = "timeline-label timeline-start";
|
startLabel.className = "timeline-label timeline-start";
|
||||||
startLabel.textContent = "-1h";
|
startLabel.textContent = "-30m";
|
||||||
|
|
||||||
const endLabel = document.createElement("div");
|
const endLabel = document.createElement("div");
|
||||||
endLabel.className = "timeline-label timeline-end";
|
endLabel.className = "timeline-label timeline-end";
|
||||||
endLabel.textContent = "+2h";
|
endLabel.textContent = "+1h";
|
||||||
|
|
||||||
track.appendChild(past);
|
track.appendChild(past);
|
||||||
track.appendChild(future);
|
track.appendChild(future);
|
||||||
|
|||||||
Reference in New Issue
Block a user