fix: remove count check on cursor
This commit is contained in:
@@ -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 == "" {
|
||||||
|
Reference in New Issue
Block a user