This commit is contained in:
@@ -154,7 +154,10 @@ func (r *mediaRepository) Delete(ctx context.Context, id pgtype.UUID) error {
|
|||||||
|
|
||||||
cacheId := fmt.Sprintf("media:id:%s", convert.UUIDToString(id))
|
cacheId := fmt.Sprintf("media:id:%s", convert.UUIDToString(id))
|
||||||
_ = r.c.Del(ctx, cacheId)
|
_ = r.c.Del(ctx, cacheId)
|
||||||
|
go func() {
|
||||||
|
bgCtx := context.Background()
|
||||||
|
_ = r.c.DelByPattern(bgCtx, "media:count*")
|
||||||
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -353,6 +353,10 @@ func (r *userRepository) Delete(ctx context.Context, id pgtype.UUID) error {
|
|||||||
fmt.Sprintf("user:email:%s", user.Email),
|
fmt.Sprintf("user:email:%s", user.Email),
|
||||||
fmt.Sprintf("user:token:%s", user.ID),
|
fmt.Sprintf("user:token:%s", user.ID),
|
||||||
)
|
)
|
||||||
|
go func() {
|
||||||
|
bgCtx := context.Background()
|
||||||
|
_ = r.c.DelByPattern(bgCtx, "user:count*")
|
||||||
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,11 @@ func (v *verificationRepository) Create(ctx context.Context, params sqlc.CreateU
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = v.c.Del(ctx, fmt.Sprintf("verification:userId:%s", convert.UUIDToString(params.UserID)))
|
_ = v.c.Del(ctx, fmt.Sprintf("verification:userId:%s", convert.UUIDToString(params.UserID)))
|
||||||
|
go func() {
|
||||||
|
bgCtx := context.Background()
|
||||||
|
_ = v.c.DelByPattern(bgCtx, "verification:count*")
|
||||||
|
}()
|
||||||
|
|
||||||
return &verification, nil
|
return &verification, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user