mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
refactor(Core/Time): Introduce GetExpirationTime instead of calculati… (#21006)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "Metric.h"
|
||||
#include "Config.h"
|
||||
#include "Log.h"
|
||||
#include "SteadyTimer.h"
|
||||
#include "Strand.h"
|
||||
#include "Tokenize.h"
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
@@ -246,9 +247,7 @@ void Metric::ScheduleSend()
|
||||
{
|
||||
if (_enabled)
|
||||
{
|
||||
// Calculate the expiration time
|
||||
auto expirationTime = std::chrono::steady_clock::now() + std::chrono::seconds(_updateInterval);
|
||||
_batchTimer->expires_at(expirationTime);
|
||||
_batchTimer->expires_at(Acore::Asio::SteadyTimer::GetExpirationTime(_updateInterval));
|
||||
_batchTimer->async_wait(std::bind(&Metric::SendBatch, this));
|
||||
}
|
||||
else
|
||||
@@ -281,9 +280,7 @@ void Metric::ScheduleOverallStatusLog()
|
||||
{
|
||||
if (_enabled)
|
||||
{
|
||||
// Calculate the expiration time _overallStatusTimerInterval from now
|
||||
auto expirationTime = std::chrono::steady_clock::now() + std::chrono::seconds(_overallStatusTimerInterval);
|
||||
_overallStatusTimer->expires_at(expirationTime);
|
||||
_overallStatusTimer->expires_at(Acore::Asio::SteadyTimer::GetExpirationTime(_overallStatusTimerInterval));
|
||||
_overallStatusTimer->async_wait([this](const boost::system::error_code&)
|
||||
{
|
||||
_overallStatusTimerTriggered = true;
|
||||
|
||||
Reference in New Issue
Block a user