Merge pull request #233 from kiwix/kiwix-serve-is-running

add isRunning method to check if the local server is running
This commit is contained in:
Matthieu Gautier 2019-06-24 15:16:31 +02:00 committed by GitHub
commit e740a511c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class KiwixServe
void run();
void shutDown();
bool isRunning();
private:
std::unique_ptr<Subprocess> mp_kiwixServe;

View File

@ -58,4 +58,12 @@ void KiwixServe::shutDown()
mp_kiwixServe->kill();
}
bool KiwixServe::isRunning()
{
if (mp_kiwixServe) {
return (mp_kiwixServe->isRunning());
}
return false;
}
}