Use stdext::millis not g_clock.millis
This commit is contained in:
parent
02d32565e9
commit
8db85e4e3a
|
@ -24,7 +24,6 @@
|
||||||
#define DATABASE_H
|
#define DATABASE_H
|
||||||
#include "declarations.h"
|
#include "declarations.h"
|
||||||
|
|
||||||
#include <framework/core/clock.h>
|
|
||||||
#include <framework/luaengine/luaobject.h>
|
#include <framework/luaengine/luaobject.h>
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
@ -48,7 +47,7 @@ class Database : public LuaObject
|
||||||
/**
|
/**
|
||||||
* Database ...
|
* Database ...
|
||||||
*/
|
*/
|
||||||
virtual void use() {m_use = g_clock.millis();}
|
virtual void use() {m_use = stdext::millis();}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database connector.
|
* Database connector.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010-2012 TitanCore <https://github.com/edubart/titancore>
|
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -76,10 +76,10 @@ bool DatabaseMySQL::handleError()
|
||||||
g_logger.error("MYSQL connection lost, trying to reconnect...");
|
g_logger.error("MYSQL connection lost, trying to reconnect...");
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
|
|
||||||
ticks_t startTime = g_clock.millis();
|
ticks_t startTime = stdext::millis();
|
||||||
while(true) {
|
while(true) {
|
||||||
bool connected = (mysql_ping(m_handle) == 0);
|
bool connected = (mysql_ping(m_handle) == 0);
|
||||||
ticks_t diffTime = (g_clock.millis() - startTime);
|
ticks_t diffTime = (stdext::millis() - startTime);
|
||||||
if(connected) {
|
if(connected) {
|
||||||
g_logger.info(stdext::format("MySQL reconneted in %d ms", diffTime));
|
g_logger.info(stdext::format("MySQL reconneted in %d ms", diffTime));
|
||||||
setConnected(true);
|
setConnected(true);
|
||||||
|
|
Loading…
Reference in New Issue