string_to_ipa icon indicating copy to clipboard operation
string_to_ipa copied to clipboard

Only open a database connection once per program

Open seydar opened this issue 2 years ago • 0 comments

Previously, the database connection was an instance variable (@database), so every word was opening a separate connection to the database. This was causing errors, where database connections would stay open until a StringToIpa object gets GCed; errors were appearing where a database would refuse new connections.

With this commit, the database connection is stored as a class variable, and thus is only opened once per program.

This fixes issue #7 (https://github.com/hilarysk/string_to_ipa/issues/7).

seydar avatar Aug 02 '22 17:08 seydar