5#include "windowsfork.h"
9#include <QCoreApplication>
10#include <QLoggingCategory>
13Q_LOGGING_CATEGORY(C_SERVER_WIN,
"cutelyst.server.windows", QtWarningMsg)
15WindowsFork::WindowsFork(
QObject *parent)
24 m_masterChildProcess =
new QProcess(
this);
28 &WindowsFork::childFinished);
31 env.insert(QStringLiteral(
"CUTELYST_WSGI_IGNORE_MASTER"), QStringLiteral(
"1"));
42 int ret = qApp->exec();
60 if (m_masterChildProcess) {
61 m_masterChildProcess->
kill();
67 if (m_masterChildProcess) {
76 if (!m_materChildRestartTimer) {
77 m_materChildRestartTimer =
new QTimer(
this);
83 m_materChildRestartTimer->
start();
86void WindowsFork::startChild()
88 m_masterChildProcess->
start();
93 qCDebug(C_SERVER_WIN) <<
"Master child finished" << exitCode << exitStatus;
101void WindowsFork::restartTerminate()
103 if (++m_autoReloadCount > 5) {
virtual void restart() override
virtual void terminateChild() override
virtual int exec(bool lazy, bool master) override
virtual bool continueMaster(int *exit=nullptr) override
virtual void killChild() override
QString applicationFilePath()
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void finished(int exitCode, QProcess::ExitStatus exitStatus)
void setArguments(const QStringList &arguments)
void setProcessChannelMode(QProcess::ProcessChannelMode mode)
void setProcessEnvironment(const QProcessEnvironment &environment)
void setProgram(const QString &program)
void start(QIODeviceBase::OpenMode mode)
QProcessEnvironment systemEnvironment()
void setInterval(int msec)
void setSingleShot(bool singleShot)