fix: remove count check on cursor
This commit is contained in:
parent
bedc3d0b50
commit
a933ac1118
|
@ -2,7 +2,6 @@ package db
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
@ -199,11 +198,6 @@ func (mgr *manager) GetUserByID(id string) (User, error) {
|
|||
}
|
||||
defer cursor.Close()
|
||||
|
||||
count := cursor.Count()
|
||||
if count == 0 {
|
||||
return user, errors.New("user not found")
|
||||
}
|
||||
|
||||
for {
|
||||
if !cursor.HasMore() {
|
||||
if user.Key == "" {
|
||||
|
|
Loading…
Reference in New Issue
Block a user