Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

出现异常 #22

Closed
liusida opened this issue Oct 27, 2016 · 1 comment
Closed

出现异常 #22

liusida opened this issue Oct 27, 2016 · 1 comment

Comments

@liusida
Copy link

liusida commented Oct 27, 2016

我用了try来执行quotation.all,以免抓取异常退出,但在服务器上执行抓取偶尔会出现如下错误:
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7faee5fb1470>

应该是异常后这里可能没执行到?
https://github.com/shidenggui/easyquotation/blob/master/easyquotation/basequotation.py#L73

查了下aiohttp的issue aio-libs/aiohttp#1175
他似乎是提倡特定的用法,但我看不太懂。

如果长时间稳定的抓取,怎样的方案比较好呢?谢谢

@liusida
Copy link
Author

liusida commented Oct 27, 2016

嗯。。。我用crontab来进行每分钟调用,然后程序就跑一次就好了,这样就不会出现这些错误了。

搞定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants