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