diff --git a/sso/services/miningbuddy/__init__.py b/sso/services/miningbuddy/__init__.py index 86784bd..e8647a6 100644 --- a/sso/services/miningbuddy/__init__.py +++ b/sso/services/miningbuddy/__init__.py @@ -38,6 +38,10 @@ class MiningBuddyService(BaseService): self._dbcursor = self._db.cursor() + def __del__(self): + self._db.close() + self._db = None + def _gen_salt(self): return settings.MINING_SALT diff --git a/sso/services/wiki/__init__.py b/sso/services/wiki/__init__.py index 2e66c0e..2da08b0 100644 --- a/sso/services/wiki/__init__.py +++ b/sso/services/wiki/__init__.py @@ -38,6 +38,10 @@ class MediawikiService(BaseService): self._dbcursor = self._db.cursor() + def __del__(self): + self._db.close() + self._db = None + def _gen_salt(self): return "%x" % random.randint(0, 2147483647)