string_to_ipa
string_to_ipa copied to clipboard
Only open a database connection once per program
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).