Grails 中的 Spring Webflow 保持大量休眠会话打开
我有一个在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的第一个建议是需要 captia 才能访问流程。如果这不是一个选项,您可以在网络流程的第一步中设置较短的会话时间,然后在第三步中将其重置为更长的时间。一个例子是
步骤一
步骤三
这将导致步骤一或步骤二中的任何会话在 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
step three
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.