Skip to content

Commit

Permalink
tasks: common: Fix race condition on pre-cleanup
Browse files Browse the repository at this point in the history
In a multi-root workspace, the pre-cleanup task could be executed
multiple times. To prevent this, we check if the extension has been
locked by another workspace and only execute the pre-cleanup task if
it's not locked.

Signed-off-by: Matheus Castello <[email protected]>
  • Loading branch information
microhobby committed Jan 26, 2024
1 parent 37e02e0 commit 3110ba8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/tasks/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,19 @@
"label": "pre-cleanup",
"detail": "",
"hide": true,
"command": "DOCKER_HOST=${config:torizon_ip}:2375",
"command": "if",
"type": "shell",
"args": [
"[", "${command:cleanLock}", "==", "false", "];" , "then",
"DOCKER_HOST=${config:torizon_ip}:2375",
"docker",
"compose",
"-p",
"torizon",
"down",
"--remove-orphans"
"--remove-orphans",
";",
"fi"
],
"dependsOrder": "sequence",
"dependsOn": [
Expand Down

0 comments on commit 3110ba8

Please sign in to comment.