Skip to content

Commit e3d91c7

Browse files
delete on exit trap
1 parent b9e0e85 commit e3d91c7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tool/ovh/tpcc.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ source tool/ovh/profile.sh
2929

3030
echo Machine name: $MACHINE_NAME
3131

32+
function cleanup {
33+
tool/ovh/download-result.sh
34+
35+
if [[ -z $KEEP_SERVER ]]; then
36+
openstack server delete $MACHINE_NAME
37+
fi
38+
}
39+
trap cleanup ERR
40+
trap cleanup EXIT
41+
3242
tool/ovh/create.sh
3343
sleep 40
3444
tool/ovh/clone-repo.sh $(git rev-parse HEAD)
@@ -44,9 +54,3 @@ tool/ovh/ssh-exec.sh "'
4454
cd typedb-benchmark && . venv/bin/activate &&
4555
nohup tool/execute-tpcc.sh --no-load --scalefactor=$SCALE_FACTOR --warehouses=$WAREHOUSES --clients=$CLIENTS --duration=$DURATION $DB & wait \$!
4656
'"
47-
48-
tool/ovh/download-result.sh
49-
50-
if [[ -z $KEEP_SERVER ]]; then
51-
openstack server delete $MACHINE_NAME
52-
fi

0 commit comments

Comments
 (0)