depot.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:solaris-ips 作者: oracle 项目源码 文件源码
def index_0(self, *tokens):
                """Provides an administrative interface for search indexing.
                Returns no output if successful; otherwise the response body
                will contain the failure details.
                """

                try:
                        cmd = tokens[0]
                except IndexError:
                        cmd = ""

                # These commands cause the operation requested to be queued
                # for later execution.  This does mean that if the operation
                # fails, the client won't know about it, but this is necessary
                # since these are long running operations (are likely to exceed
                # connection timeout limits).
                try:
                        if cmd == "refresh":
                                # Update search indexes.
                                self.__bgtask.put(self.repo.refresh_index,
                                    pub=self._get_req_pub())
                        else:
                                err = "Unknown index subcommand: {0}".format(
                                    cmd)
                                cherrypy.log(err)
                                raise cherrypy.HTTPError(http_client.NOT_FOUND, err)
                except queue.Full:
                        raise cherrypy.HTTPError(http_client.SERVICE_UNAVAILABLE,
                           "Another operation is already in progress; try "
                           "again later.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号