Skip to content

Commit

Permalink
optimized autorefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
RaBa64 committed Jun 26, 2023
1 parent 4a8078a commit 4b88413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions webapp/src/components/BarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,11 @@ export default defineComponent({
},
startautorefresh() {
var nextDate = new Date();
if (nextDate.getMinutes() === 0) {
this.callEveryHour()
} else {
nextDate.setHours(nextDate.getHours() + 1);
nextDate.setMinutes(0);
nextDate.setSeconds(10);
var difference:number = nextDate.valueOf() - Date.now();
setTimeout(this.callEveryHour, difference);
}
nextDate.setHours(nextDate.getHours() + 1);
nextDate.setMinutes(0);
nextDate.setSeconds(5);
var difference: number = nextDate.valueOf() - Date.now();
setTimeout(this.callEveryHour, difference);
},
}
});
Expand Down
Binary file modified webapp_dist/js/app.js.gz
Binary file not shown.

0 comments on commit 4b88413

Please sign in to comment.