mirror of
https://github.com/QuasarApp/Patronum.git
synced 2025-04-26 07:34:32 +00:00
fix stop
This commit is contained in:
parent
15ea706042
commit
063ff4ece3
@ -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() {
|
||||
|
@ -130,7 +130,7 @@ protected:
|
||||
|
||||
private:
|
||||
ControllerPrivate *d_ptr = nullptr;
|
||||
|
||||
bool _disableFinished = false;
|
||||
void printDefaultHelp() const;
|
||||
};
|
||||
}
|
||||
|
@ -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()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user