implement usage of native cgroups instead of systemd-run

* allow server to be started w\o daemon
* handle process childs
This commit is contained in:
2017-11-10 01:33:23 +03:00
parent 2bd72344ba
commit 3717d1426e
12 changed files with 228 additions and 212 deletions

View File

@ -18,6 +18,8 @@
#include <queued/Queued.h>
#include <QCoreApplication>
#include "QueuedTcpServer.h"
@ -43,6 +45,15 @@ QueuedServer::~QueuedServer()
void QueuedServer::init()
{
while (QueuedCoreAdaptor::getStatus().type() != Result::Content::Value) {
qCWarning(LOG_SERV)
<< "Daemon seems to be unavailable wait" << WAIT_FOR_DAEMON;
QTime timer = QTime::currentTime().addMSecs(WAIT_FOR_DAEMON);
while (QTime::currentTime() < timer)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
m_server->init(QueuedCoreAdaptor::getOption(
QueuedConfig::QueuedSettings::ServerTimeout)
.get()

View File

@ -28,6 +28,8 @@ class QueuedServer : public QObject
Q_OBJECT
public:
static const long WAIT_FOR_DAEMON = 30000;
explicit QueuedServer(QObject *parent, const QVariantHash &args);
virtual ~QueuedServer();
void init();