server/serverctl.py
changeset 9797 4e640ab62f51
parent 9759 846bc9227394
child 9890 57e2cffa6329
equal deleted inserted replaced
9796:2d1e488f6f71 9797:4e640ab62f51
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   977     def run(self, args):
   977     def run(self, args):
   978         from cubicweb.server.checkintegrity import check
   978         from cubicweb.server.checkintegrity import check
   979         appid = args[0]
   979         appid = args[0]
   980         config = ServerConfiguration.config_for(appid)
   980         config = ServerConfiguration.config_for(appid)
   981         config.repairing = self.config.force
   981         config.repairing = self.config.force
   982         repo, cnx = repo_cnx(config)
   982         repo, _cnx = repo_cnx(config)
   983         with cnx:
   983         with repo.internal_cnx() as cnx:
   984             check(repo, cnx,
   984             check(repo, cnx,
   985                   self.config.checks, self.config.reindex, self.config.autofix)
   985                   self.config.checks,
       
   986                   self.config.reindex,
       
   987                   self.config.autofix)
   986 
   988 
   987 
   989 
   988 class RebuildFTICommand(Command):
   990 class RebuildFTICommand(Command):
   989     """Rebuild the full-text index of the system database of an instance.
   991     """Rebuild the full-text index of the system database of an instance.
   990 
   992