Grails 中的 Spring Webflow 保持大量休眠会话打开

发布于 2024-08-30 10:54:45 字数 245 浏览 1 评论 0原文

我有一个在 Grails 1.1.2 上运行的互联网应用程序,它集成了 Spring WebFlow 机制。问题在于,有些机器人会忽略 robots.txt,并且经常进入流程。

由于流程的第二步需要一些人类智能,因此机器人在第一步后会留下开放的流程。这会导致大量开放流量,从而导致大量废弃的开放休眠会话。

您知道 Grails+Spring WebFlow 中此类无人值守流(加上休眠会话)的一些常见清理机制吗?

谢谢, 帕维尔

I have an Internet app running on Grails 1.1.2 and it integrates Spring WebFlow mechanism. The problem is that there are some bots ignoring robots.txt and are entering the flow quite often.

Because second step of the flow needs some human intelligence, the bot leaves open flow after the first step. This causes a lot of open flows which leades to a lot of abandoned open hibernate sessions.

Do you know some common clean-up mechanism for this kind of unattended flows (plus hibernate sessions) in Grails+Spring WebFlow?

Thanks,
Pavel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陪你到最终 2024-09-06 10:54:45

我的第一个建议是需要 captia 才能访问流程。如果这不是一个选项,您可以在网络流程的第一步中设置较短的会话时间,然后在第三步中将其重置为更长的时间。一个例子是
步骤一

session.setMaxInactiveInterval(60);

步骤三

session.setMaxInactiveInterval(600);

这将导致步骤一或步骤二中的任何会话在 60 秒不活动后终止。当会话终止时,与该会话关联的所有休眠会话都将被清除。假设用户在 60 秒内完成步骤一和步骤二,他们将有 10 分钟的时间来完成每个附加步骤。

My first suggestion would be to require a captia in order to access the flow. If that isn't an option you could set a short session time in step one of the web flow, then reset it to something longer in step three. An example is
step one

session.setMaxInactiveInterval(60);

step three

session.setMaxInactiveInterval(600);

This will cause any session in step one or two to die after 60 seconds of inactivity. When the session dies any hibernate sessions associated with the session will be cleaned up. Assuming the user completes steps one and two in fewer than 60 seconds they will have 10 minutes to complete each additional step.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文