+def es
- ESClient.new(index: 'accounts')
end
I think es function is unnecessary.
+def store_account_info(my_info)
return if check_account_exist(my_info['my_email'])
es.put_source_by_id(my_info['my_email'], my_info)
please use directly here.
because 2 functions -> store_account_info and check_account_exist all use es "ESClient.new(index: 'accounts')", so separate es function.
Thanks, Yinsi
Thanks, Liushaofei
end
+def check_account_exist(email)
- return true if es.query_by_id(email)
- return false
end
store_account_info(my_info)