As the config become more, the old way will store more and more info to es, and they are not all necessary, and their changes sometimes will cause conflict with old data in es.
So only store necessary info now.
Signed-off-by: Li Yuanchao lyc163mail@163.com --- lib/git_mirror.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 346352b..76cdd1b 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -288,8 +288,8 @@ class MirrorMain end
def es_repo_update(git_repo) - repo_info = @git_info[git_repo].merge(@fork_stat[git_repo]) - repo_info.delete(:cur_refs) if repo_info.key?(:cur_refs) + repo_info = { 'git_repo' => git_repo, 'url' => @git_info[git_repo]['url'] } + repo_info = repo_info.merge(@fork_stat[git_repo]) body = { "doc": repo_info, "doc_as_upsert": true