Skip to content

Commit

Permalink
Edit on.exit() handler
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Apr 14, 2020
1 parent 80ae241 commit e24abf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/txtq.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ R6_txtq <- R6::R6Class(
private$txtq_validate()
},
txtq_exclusive = function(code) {
on.exit(filelock::unlock(lock))
on.exit(unlink(private$lock_file), add = TRUE)
lock <- filelock::lock(private$lock_file)
on.exit({
filelock::unlock(lock)
unlink(private$lock_file)
})
force(code)
},
txtq_get_head = function() {
Expand Down

0 comments on commit e24abf6

Please sign in to comment.