mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
weather: better naming for update cycle
Origin commit data
------------------
Branch: ni/coolstream
Commit: 727a63718a
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-03-20 (Wed, 20 Mar 2019)
Origin message was:
------------------
- weather: better naming for update cycle
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "weather.h"
|
#include "weather.h"
|
||||||
|
|
||||||
#define MINUTES 15*60
|
#define UPDATE_CYCLE 15 // minutes
|
||||||
|
|
||||||
CWeather* CWeather::getInstance()
|
CWeather* CWeather::getInstance()
|
||||||
{
|
{
|
||||||
@@ -82,7 +82,7 @@ void CWeather::setCoords(std::string new_coords, std::string new_city)
|
|||||||
bool CWeather::checkUpdate(bool forceUpdate)
|
bool CWeather::checkUpdate(bool forceUpdate)
|
||||||
{
|
{
|
||||||
time_t current_time = time(NULL);
|
time_t current_time = time(NULL);
|
||||||
if (forceUpdate || (difftime(current_time,last_time) > MINUTES))
|
if (forceUpdate || (difftime(current_time, last_time) > (UPDATE_CYCLE * 60)))
|
||||||
return GetWeatherDetails();
|
return GetWeatherDetails();
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user