Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

threads: fetch all unknown records #132

Merged
merged 7 commits into from
Nov 28, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
Signed-off-by: jsign <[email protected]>
  • Loading branch information
jsign committed Nov 26, 2019
commit b08aabae881e85195750f930532a45d3f70d2c3c
11 changes: 3 additions & 8 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,10 @@ func (s *service) PushLog(ctx context.Context, req *pb.PushLogRequest) (*pb.Push
}

lg := logFromProto(req.Log)
head, err := s.threads.store.Heads(req.ThreadID.ID, lg.ID)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}

// Fix concurrency: adding head without having the block guarantee
if head == nil {
if err := s.threads.store.AddLog(req.ThreadID.ID, lg); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
if err := s.threads.store.AddLog(req.ThreadID.ID, lg); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}

func() {
Expand Down