Proper context.Context usage

This commit is contained in:
Caleb Gardner
2024-10-24 00:00:08 -05:00
parent fcab9458ee
commit 6965917e76
19 changed files with 126 additions and 118 deletions
+2 -2
View File
@@ -49,8 +49,8 @@ func (s *SWBackend) AddBackend(b *backend.Backend) {
s.back = b
}
func (s *SWBackend) AddCrash(cr backend.IndividualCrash) bool {
res := s.db.Collection("versions").FindOne(context.Background(), bson.M{"version": cr.Version})
func (s *SWBackend) ShouldAddCrash(ctx context.Context, cr backend.IndividualCrash) bool {
res := s.db.Collection("versions").FindOne(ctx, bson.M{"version": cr.Version})
return res.Err() != mongo.ErrNoDocuments
}