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

Feature: 给 save stock_info 等命令行 增加 option --overwrite/append #946

Open
yssource opened this issue Jan 8, 2019 · 2 comments

Comments

@yssource
Copy link
Contributor

yssource commented Jan 8, 2019

当前版本, save stock_info 会 client.drop_collection('stock_info')。 不是好的方案。

原因: 遇到网络问题, 会出现 ERROR CODE。造成部分 code 不能成功入库。即使多次 save stock_info, 也会重复删表和建表,如果网络不好, 依旧会有新的 ERROR CODE。

建议: 提供更多的 options 给 save stock_info

  • 默认 overwrite, 删表和重新建表
    save stock_info
  • append, 不会删表, 根据上一次出现的 ERROR CODE 做补齐。将 [code list] 传给 stock_list 做增量更新。
    save stock_info --append [code list]

类似 client.drop_collection('stock_info'), 有好几处, 比如 client.drop_collection('stock_xdxr') 等。

有空我再给你提 PR

@yssource yssource changed the title Feature: 给 save stock_info 等命令行 增加 option --override/append Feature: 给 save stock_info 等命令行 增加 option --overwrite/append Jan 8, 2019
@yutiansut
Copy link
Owner

yutiansut commented Jan 9, 2019

唔 其实这块后面是要重做的 全部变成unique index 和 upsert @yssource

@yssource
Copy link
Contributor Author

既然要重构, 我暂时不PR了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment