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:
10
src/run.cpp
10
src/run.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user