Skip to content
Snippets Groups Projects
Commit 13e2d320 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Cache commit's author and committer when indexing a commit

... as these data are not cached in rugged.
parent 6db56716
No related branches found
No related tags found
1 merge request!22Cache commit's author and committer when indexing a commit
Pipeline #
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