Skip to content

Commit

Permalink
disconnect on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
edavidaja committed Dec 4, 2019
1 parent fb00a9b commit 9d4cb7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ con <- dbConnect(
password = Sys.getenv("DB_PASS")
)


dbRemoveTable(con, "todos")
dbDisconnect(con)

dbSendQuery(
con,
'CREATE TABLE todos (
Expand Down Expand Up @@ -139,3 +135,8 @@ function(req, res, id, title, order, completed) {
get_todo(con)
}
}


on.exit(
dbDisconnect(con)
)

0 comments on commit 9d4cb7c

Please sign in to comment.