
On Wed, Jan 27, 2021 at 02:12:58PM +0800, Liu Yinsi wrote:
before: when store account info to ES, generate new my_token. after: when store account info to ES, if my_email exist, use old my_token, if not exist, generate new my_token.
[why] prevent my_token in config yaml is different with ES.
the old script may generate new my_token, but it will update both es and the yaml files. this new version just keep the old info if it exists include my_name, my_token, not only include my_token Thanks, Luan Shengde
Signed-off-by: Liu Yinsi <liuyinsi@163.com> --- lib/build_my_info_client.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 lib/build_my_info_client.rb
diff --git a/lib/build_my_info_client.rb b/lib/build_my_info_client.rb old mode 100644 new mode 100755 index c946bec..6aa842c --- a/lib/build_my_info_client.rb +++ b/lib/build_my_info_client.rb @@ -66,12 +66,16 @@ class BuildMyInfo
def store_account_info es = ESClient.new(index: 'accounts') + + my_info_es = es.query_by_id(@my_info['my_email']) || {} + @my_info.update my_info_es + es.put_source_by_id(@my_info['my_email'], @my_info) end
def config_my_info + store_account_info config_default_yaml config_lab_yaml - store_account_info end end -- 2.23.0