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.
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
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
On Wed, Jan 27, 2021 at 04:52:51PM +0800, Luan Shengde wrote:
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.
yes
this new version just keep the old info if it exists include my_name, my_token, not only include my_token
i will correct it
Thanks, Yinsi
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
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
i found the key of question is not here, this patch has no value. if add params my_token when config yaml, my_token will not generate new token.
Thanks, Yinsi
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