Skip to content
Snippets Groups Projects
Commit 4015a896 authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge branch 'cache-commit-author-committer' into 'master'

Cache commit's author and committer when indexing a commit

... as these data are not cached in rugged. It makes some difference for repos with large number of commits.

See merge request !22
parents 6db56716 1146ec48
No related branches found
No related tags found
1 merge request!22Cache commit's author and committer when indexing a commit
Pipeline #
1.0.2
- Cache commit's author and committer when indexing a commit
1.0.1
- Yield current batch and total count when indexing
 
Loading
Loading
Loading
Loading
@@ -217,6 +217,9 @@ module Elasticsearch
end
 
def index_commit(commit)
author = commit.author
committer = commit.committer
{
index: {
_index: "#{self.class.index_name}",
Loading
Loading
@@ -229,14 +232,14 @@ module Elasticsearch
rid: repository_id,
sha: commit.oid,
author: {
name: encode!(commit.author[:name]),
email: encode!(commit.author[:email]),
time: commit.author[:time].strftime('%Y%m%dT%H%M%S%z'),
name: encode!(author[:name]),
email: encode!(author[:email]),
time: author[:time].strftime('%Y%m%dT%H%M%S%z'),
},
committer: {
name: encode!(commit.committer[:name]),
email: encode!(commit.committer[:email]),
time: commit.committer[:time].strftime('%Y%m%dT%H%M%S%z'),
name: encode!(committer[:name]),
email: encode!(committer[:email]),
time: committer[:time].strftime('%Y%m%dT%H%M%S%z'),
},
message: encode!(commit.message)
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment