mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
failure to remove rundir should not abort the jobrunner
kj::Directory::remove will throw if it fails to remove some files, e.g. in case of insufficient permissions. Catch this and move right along. resolves #156
This commit is contained in:
parent
02810309fc
commit
d01cf1c9b0
@ -774,7 +774,14 @@ void Laminar::handleRunFinished(Run * r) {
|
|||||||
// anyway so hence this (admittedly debatable) optimization.
|
// anyway so hence this (admittedly debatable) optimization.
|
||||||
if(!fsHome->exists(d))
|
if(!fsHome->exists(d))
|
||||||
break;
|
break;
|
||||||
fsHome->remove(d);
|
// must use a try/catch because remove will throw if deletion fails. Using
|
||||||
|
// tryRemove does not help because it still throws an exception for some
|
||||||
|
// errors such as EACCES
|
||||||
|
try {
|
||||||
|
fsHome->remove(d);
|
||||||
|
} catch(kj::Exception& e) {
|
||||||
|
LLOG(ERROR, "Could not remove directory", e.getDescription());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fsHome->symlink(kj::Path{"archive", r->name, "latest"}, std::to_string(r->build), kj::WriteMode::CREATE|kj::WriteMode::MODIFY);
|
fsHome->symlink(kj::Path{"archive", r->name, "latest"}, std::to_string(r->build), kj::WriteMode::CREATE|kj::WriteMode::MODIFY);
|
||||||
|
Loading…
Reference in New Issue
Block a user