From 12824d6457751a98cfc08e29eb3009610c648fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 17 Apr 2017 00:17:09 +0200 Subject: [PATCH] Reset the database list cache on the right class issue6429 review35371003 --- trytond/backend/postgresql/database.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trytond/backend/postgresql/database.py b/trytond/backend/postgresql/database.py index 786dccb3dd..d45026ce29 100644 --- a/trytond/backend/postgresql/database.py +++ b/trytond/backend/postgresql/database.py @@ -151,7 +151,7 @@ class Database(DatabaseInterface): def drop(self, connection, database_name): cursor = connection.cursor() cursor.execute('DROP DATABASE "' + database_name + '"') - Database._list_cache = None + self.__class__._list_cache = None def get_version(self, connection): if self.name not in self._version_cache: @@ -165,8 +165,8 @@ class Database(DatabaseInterface): def list(self): now = time.time() timeout = config.getint('session', 'timeout') - res = Database._list_cache - if res and abs(Database._list_cache_timestamp - now) < timeout: + res = self.__class__._list_cache + if res and abs(self.__class__._list_cache_timestamp - now) < timeout: return res connection = self.get_connection() @@ -183,8 +183,8 @@ class Database(DatabaseInterface): continue self.put_connection(connection) - Database._list_cache = res - Database._list_cache_timestamp = now + self.__class__._list_cache = res + self.__class__._list_cache_timestamp = now return res def init(self):