Closed ghost closed 3 years ago
It doesn't say you should close it as soon as possible. Maybe this wording could be better.
Something like:
A
levelup
instance has associated resources like file handles and locks. When you no longer need yourlevelup
instance (for the remainder of your program) callclose()
to free up resources.
@vweevers Looks good!
So I should open it once and keep it open till my app don't need it anymore. Is that right?
So I should open it once and keep it open till my app don't need it anymore. Is that right?
Correct.
Great! So @vweevers, that sounds good!
Hey, awesome community! How u doing?
From the docs about close():
and also from the docs about open():
So If I got it, I should open the database using level() to execute some operations and, as soon as possible, I should close it using close(). What about after that, when I need to execute some more operations? What is the best way to reopen it and close it again?!