Fixed issue that caused the server to fall asleep too early

This commit is contained in:
Leonetienne 2021-03-04 11:26:55 +01:00
parent 3556d6eb5c
commit 82edabae45
2 changed files with 4 additions and 4 deletions

View File

@ -1,12 +1,12 @@
#include "Idler.h"
#include <iostream>
#define TIME_TO_FALL_ASLEEP MINUTES(5)
#define TIME_TO_FALL_ASLEEP MINUTES(3)
#define SLEEP_TIME SECONDS(3)
void Idler::Update()
{
// Has no request been made within 3 minutes?
if (time(0) - XGControl::last_query_time > 10)
// Has no request been made within x minutes?
if (time(0) - XGControl::last_query_time > TIME_TO_FALL_ASLEEP)
{
// Let the processor chill for a second.
// This should reduce the idling-cpu load to near 0%

View File

@ -1,2 +1,2 @@
#pragma once
#define TUBIO_SERVER_VERSION (0.536)
#define TUBIO_SERVER_VERSION (0.537)