Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a0b063

Browse files
committed
bugfix
1 parent b592faf commit 7a0b063

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

logic/interview_question.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,9 @@ func (InterviewLogic) UpdateTodayQuestionID() {
122122
defer redis.Close()
123123

124124
id := goutils.MustInt(redis.GET(questionIDKey), 0)
125+
id = (id + 1) % (question.Id + 1)
125126
if id == 0 {
126127
id = 1
127-
} else {
128-
id = (id + 1) % question.Id
129128
}
130129
redis.SET(questionIDKey, id, 0)
131130
}

0 commit comments

Comments
 (0)