Merge pull request #170 from overleaf/jpa-import-141

[DockerRunner] destroyOldContainers: fix a race confition
This commit is contained in:
Brian Gough
2020-06-02 09:04:59 +01:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -642,6 +642,9 @@ module.exports = DockerRunner = {
ttl
) {
if (name.slice(0, 9) === '/project-' && ttl <= 0) {
// strip the / prefix
// the LockManager uses the plain container name
name = name.slice(1)
return jobs.push(cb =>
DockerRunner.destroyContainer(name, id, false, () => cb())
)