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

关于长期保持登录状态的问题 #98

Closed
fjfzzl opened this issue Aug 25, 2016 · 3 comments
Closed

关于长期保持登录状态的问题 #98

fjfzzl opened this issue Aug 25, 2016 · 3 comments

Comments

@fjfzzl
Copy link

fjfzzl commented Aug 25, 2016

我想问一下,我在执行user = easytrader.use('yjb') 和 user.prepare('yjb.json') ,登录之后,多长时间不操作,session会失效,能否在你的程序中,直接加入维持登陆状态的功能。因为有时候策略需要运行几个月时间,万一被服务器踢出了,程序执行就会出现不可预见的错误,这个很麻烦。

盼回复!

@shidenggui
Copy link
Owner

目前已经有心跳线程 10 s 发送一次心跳。但是有时候还是会掉线

@fjfzzl
Copy link
Author

fjfzzl commented Aug 25, 2016

那能否加一个函数功能,用来判断是否在登录状态,这样子在策略运行过程中,先判断是否在登录状态,如果是,直接下单,如果不是,再重新登录,然后下单。或者说,你的那个线程判断如果掉线了,再重新登录直到成功。
不管怎样,你还是开放一个判断是否在登录状态的函数吧。

@shidenggui
Copy link
Owner

这个已经有了,你可以直接看源码

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