mirror of
https://github.com/logos-messaging/nim-chat-sdk.git
synced 2026-01-02 14:13:07 +00:00
chore: use defer for db close
This commit is contained in:
parent
3fe8fb2a03
commit
a0bdb421ff
@ -3,10 +3,10 @@ import chat_sdk/migration
|
||||
|
||||
proc main() =
|
||||
let db = open("test.db", "", "", "")
|
||||
try:
|
||||
runMigrations(db)
|
||||
finally:
|
||||
defer:
|
||||
db.close()
|
||||
|
||||
runMigrations(db)
|
||||
|
||||
when isMainModule:
|
||||
main()
|
||||
Loading…
x
Reference in New Issue
Block a user