Skip to content

Commit

Permalink
fix(post_processing): convert DirectoryReply to FileDirectory for ser…
Browse files Browse the repository at this point in the history
…ving data (#3604)
  • Loading branch information
schroederc committed Mar 11, 2019
1 parent 8358e75 commit 0ef9b74
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion kythe/go/serving/pipeline/pipeline.go
Expand Up @@ -225,7 +225,21 @@ func writeFileTree(ctx context.Context, tree *filetree.Map, out table.Proto) err
for corpus, roots := range tree.M {
for root, dirs := range roots {
for path, dir := range dirs {
if err := buffer.Put(ctx, ftsrv.PrefixedDirKey(corpus, root, path), dir); err != nil {
fd := &srvpb.FileDirectory{}
for _, e := range dir.Entry {
kind := srvpb.FileDirectory_UNKNOWN
switch e.Kind {
case ftpb.DirectoryReply_FILE:
kind = srvpb.FileDirectory_FILE
case ftpb.DirectoryReply_DIRECTORY:
kind = srvpb.FileDirectory_DIRECTORY
}
fd.Entry = append(fd.Entry, &srvpb.FileDirectory_Entry{
Kind: kind,
Name: e.Name,
})
}
if err := buffer.Put(ctx, ftsrv.PrefixedDirKey(corpus, root, path), fd); err != nil {
return err
}
}
Expand Down

0 comments on commit 0ef9b74

Please sign in to comment.