Claim search port #5
4 changed files with 14 additions and 0 deletions
6
action.yml
Normal file
6
action.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
# action.yml
|
||||
name: 'Hub'
|
||||
description: 'Run go hub'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'dev.dockerfile'
|
5
dev.dockerfile
Normal file
5
dev.dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM debian:10-slim
|
||||
|
||||
EXPOSE 50051
|
||||
COPY ./hub /hub
|
||||
ENTRYPOINT ["/hub", "serve", "--dev"]
|
1
main.go
1
main.go
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue