From 5124972ea778c8f49a225a1d889274f7aaa08329 Mon Sep 17 00:00:00 2001 From: lxnay Date: Tue, 27 May 2008 11:01:40 +0000 Subject: [PATCH] Entropy/Repository Server: - do not spam stdout if databases are not available git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1982 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/entropy.py b/libraries/entropy.py index 6dff1a4b9..f17fdf5a3 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -15429,6 +15429,7 @@ class RepositorySocketServerInterface(SocketHostInterface): self.LockScanner = None self.syscache = { 'db': {}, + 'dbs_not_available': set(), } etpConst['socket_service']['max_connections'] = 5000 SocketHostInterface.__init__( @@ -15454,6 +15455,8 @@ class RepositorySocketServerInterface(SocketHostInterface): self.repositories[repo_tuple]['enabled'] = False mydbpath = os.path.join(self.repositories[repo_tuple]['dbpath'],etpConst['etpdatabasefile']) if os.path.isfile(mydbpath) and os.access(mydbpath, os.W_OK): + if repo_tuple in self.syscache['dbs_not_available']: + self.syscache['dbs_not_available'].remove(x) self.repositories[repo_tuple]['enabled'] = True def is_repository_available(self, repo_tuple): @@ -15475,6 +15478,9 @@ class RepositorySocketServerInterface(SocketHostInterface): x = (repository,arch,product) self.set_repository_db_availability(x) if not self.repositories[x]['enabled']: + if x in self.syscache['dbs_not_available']: + continue + self.syscache['dbs_not_available'].add(x) mytxt = blue("%s.") % (_("database does not exist. Locking services for it"),) self.updateProgress( "[%s] %s" % (