Skip to content

Commit

Permalink
Fix a bug that timer for TSqlDatabasePool stops. #279
Browse files Browse the repository at this point in the history
  • Loading branch information
treefrogframework committed Dec 1, 2019
1 parent cffa538 commit 3272384
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/thttprequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void THttpRequest::parseBody(const QByteArray &body, const THttpRequestHeader &h
} else {
tSystemWarn("unsupported content-type: %s", qPrintable(ctype));
}
/* FALLTHRU */ }
} /* FALLTHRU */

case Tf::Get: {
// query parameter
Expand Down
4 changes: 4 additions & 0 deletions src/tmultiplexingserver_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ bool TMultiplexingServer::start(bool debugMode)
}
}

// To work a timer in main thread
TSqlDatabasePool::instance();
TKvsDatabasePool::instance();

TStaticInitializeThread::exec();
QThread::start();
return true;
Expand Down
6 changes: 6 additions & 0 deletions src/tthreadapplicationserver_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <TWebApplication>
#include <TAppSettings>
#include <TActionThread>
#include "tsqldatabasepool.h"
#include "tkvsdatabasepool.h"
#include "tsystemglobal.h"
#include "tfcore_unix.h"
#include <thread>
Expand Down Expand Up @@ -61,6 +63,10 @@ bool TThreadApplicationServer::start(bool debugMode)
return false;
}

// To work a timer in main thread
TSqlDatabasePool::instance();
TKvsDatabasePool::instance();

TStaticInitializeThread::exec();
QThread::start();
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/twebapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ namespace {
/*!
Constructor.
*/
TWebApplication::TWebApplication(int &argc, char **argv)
TWebApplication::TWebApplication(int &argc, char **argv) :
#ifdef TF_USE_GUI_MODULE
: QApplication(argc, argv),
QApplication(argc, argv),
#else
: QCoreApplication(argc, argv),
QCoreApplication(argc, argv),
#endif
_dbEnvironment(DEFAULT_DATABASE_ENVIRONMENT)
{
Expand Down

0 comments on commit 3272384

Please sign in to comment.