Skip to content

LamNguyen done assignment about redis week2#29

Open
lamhieo02 wants to merge 2 commits intoEngineerProOrg:scott/sample-gormfrom
lamhieo02:LamNguyen-BaiTap-Redis
Open

LamNguyen done assignment about redis week2#29
lamhieo02 wants to merge 2 commits intoEngineerProOrg:scott/sample-gormfrom
lamhieo02:LamNguyen-BaiTap-Redis

Conversation

@lamhieo02
Copy link

LamNguyen submit assginment week 2 about redis, hope you guys will review for me.

@lamhieo02 lamhieo02 force-pushed the LamNguyen-BaiTap-Redis branch from 5cc0fd8 to eed3108 Compare June 6, 2023 17:23

setNXResult := redisClient.SetNX(ctx, lockKey, lockValue, time.Duration(5000000000))
if setNXResult.Err() != nil || !setNXResult.Val() {
ctx.JSON(400, gin.H{"error": "lock is being used"})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if lock is being used, then we should retry till we can get it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand how to solve this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants