This commit is contained in:
Andrei Yankovich 2021-10-13 21:15:27 +03:00
parent 15ea706042
commit 063ff4ece3
3 changed files with 6 additions and 7 deletions

View File

@ -98,6 +98,8 @@ bool Controller::sendStop() {
return false;
}
_disableFinished = true;
return d_ptr->stop();
}
@ -155,7 +157,8 @@ void Controller::handleResponce(const QVariantMap &responce) {
}
void Controller::finished() {
QCoreApplication::exit(0);
if (!_disableFinished)
QCoreApplication::exit(0);
}
QList<Feature> Controller::features() {

View File

@ -130,7 +130,7 @@ protected:
private:
ControllerPrivate *d_ptr = nullptr;
bool _disableFinished = false;
void printDefaultHelp() const;
};
}

View File

@ -179,10 +179,6 @@ int ServiceBase::exec() {
if (fStart || fDaemon) {
if (fDaemon) {
if (controller()->sendStop()) {
std::this_thread::sleep_for (std::chrono::milliseconds(500));
}
if (!d_ptr->startDeamon())
return Patronum::PatronumError::UnsupportedPlatform;
return 0;
@ -190,7 +186,7 @@ int ServiceBase::exec() {
QTimer::singleShot(0, nullptr, [this]() {
if (controller()->sendStop()) {
std::this_thread::sleep_for (std::chrono::milliseconds(500));
std::this_thread::sleep_for (std::chrono::milliseconds(1000));
}
if (!d_ptr->start()) {