3

我按照本教程使用 Tomcat 7 在 Ubuntu 服务器上安装 OpenGrok。我创建了一个 cron 作业,它将触发 OpenGrok 在一夜之间更新其索引。

如果我浏览我的源代码树,通过访问http://mysite/opengrok/xref/,显示的内容是最新的。所以索引显然有效。但是如果我访问主页,内容已经过时了。项目列表不正确,页脚显示:

创建的索引 XXXX

其中“ XXXX ”是几周前的日期。Ctrl-F5 没有帮助。

一些实验已经确定,如果我重新启动 Tomcat,主页就会更新。但这似乎是一个相当严厉的解决方法。还有其他方法可以强制更新主页吗?

有人建议我检查cacheTTLweb.xml 中的值,但没有指定,这显然意味着默认值为 5 秒(来源)。

有什么建议么?

4

1 回答 1

0

I have few suggestions about debugging this problem

  1. This might be related to browser caching did you try viewing the page with other browsers?
  2. Tomcat might be caching the page.
  3. Tomcat reloads the app when it restarts. But you can reload the app easily without hassle by defining the resources you would like to be reloaded as WatchedResource as illustrated below.

    <Host>
    <Context ... reloadable="true">
     <WatchedResource>path/to/watched/resource</WatchedResource>
     <WatchedResource>another/path/to/another/resource</WatchedResource>
    </Context>
    </Host>
    
    • This way Catalina can also watch the requested files in addition to it's classes/libraries/configuration files and reload the resource. But, I would suggest using Tcat for such operations.

Let me know if you make any progress.

于 2014-06-15T13:15:43.387 回答