Skip to content

Commit

Permalink
repl: pass ObjCache as argument to finish()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Edgin committed Sep 16, 2024
1 parent 675071e commit 028e57d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions repl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ replicate() {

validate_repl_conds "$procMult" "$srcResc" "$destResc" "$untilTS"
prep_logging
trap 'finish $?' EXIT
trap 'finish "$ObjCache" $?' EXIT
ObjCache="$(mktemp)"

printf 'retrieving data objects to replicate...\n' >&2
Expand Down Expand Up @@ -281,10 +281,11 @@ replicate() {
}

finish() {
local exitCode="$1"
local objCache="$1"
local exitCode="$2"

if [[ -z "$DEBUG" && -n "${ObjCache-}" ]]; then
rm --force "$ObjCache"
if [[ -z "$DEBUG" && -n "${objCache-}" ]]; then
rm --force "$objCache"
fi

eval "exec 1>&$LOG $LOG>&-"
Expand Down

0 comments on commit 028e57d

Please sign in to comment.