1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-11-02 16:44:45 +00:00

resolves #52: timeout prevents .after script

Mark .after scripts as executing even after a timeout abort
This commit is contained in:
Oliver Giles
2018-09-09 12:15:23 +03:00
parent a2d30ad2ea
commit ab7be5a6c9
4 changed files with 16 additions and 15 deletions

View File

@@ -128,17 +128,17 @@ bool Run::step() {
return false;
}
void Run::addScript(std::string scriptPath, std::string scriptWorkingDir) {
scripts.push({scriptPath, scriptWorkingDir});
void Run::addScript(std::string scriptPath, std::string scriptWorkingDir, bool runOnAbort) {
scripts.push({scriptPath, scriptWorkingDir, runOnAbort});
}
void Run::addEnv(std::string path) {
env.push_back(path);
}
void Run::abort() {
// clear all pending scripts
std::queue<Script>().swap(scripts);
void Run::abort(bool respectRunOnAbort) {
while(scripts.size() && (!respectRunOnAbort || !scripts.front().runOnAbort))
scripts.pop();
// if the Maybe is empty, wait() was already called on this process
KJ_IF_MAYBE(p, current_pid) {
kill(-*p, SIGTERM);