Claim search port #5

Merged
jeffreypicard merged 32 commits from claim_search_port into master 2021-06-23 17:07:41 +02:00
4 changed files with 14 additions and 0 deletions
Showing only changes of commit c70467335b - Show all commits

6
action.yml Normal file
View file

@ -0,0 +1,6 @@
# action.yml
name: 'Hub'
description: 'Run go hub'
runs:
using: 'docker'
image: 'dev.dockerfile'

5
dev.dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM debian:10-slim
EXPOSE 50051
COPY ./hub /hub
ENTRYPOINT ["/hub", "serve", "--dev"]

View file

@ -150,6 +150,7 @@ func main() {
reflection.Register(s.GrpcServer)
log.Printf("listening on %s\n", l.Addr().String())
log.Println(s.Args)
if err := s.GrpcServer.Serve(l); err != nil {
log.Fatalf("failed to serve: %v", err)
}

View file

@ -159,6 +159,7 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
esUrl := s.Args.EsHost + ":" + s.Args.EsPort
tmpClient, err := elastic.NewClient(elastic.SetURL(esUrl), elastic.SetSniff(false))
if err != nil {
log.Println(err)
return nil, err
}
client = tmpClient
@ -444,6 +445,7 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
searchResult, err := search.Do(ctx) // execute
if err != nil {
log.Println(err)
return nil, err
}