Skip to content

Commit

Permalink
test: change update user record logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Rorical committed Jul 26, 2023
1 parent 2f71d75 commit 8984249
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/storer/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ func (st *Storer) handleDatabase(dataq *source.DataQueue) error {
}
}

err = st.ops.UpdateUserIllustsTime(ctx, resdata.UserID)
if err != nil {
st.tracer.FailTask(data.Group, err.Error())
return err
}

if user != nil && illustCount != user.IllustsCount || user == nil {
for id := range resdata.Illusts {
exist, err := st.ops.IsIllustExist(resdata.Illusts[id])
Expand Down Expand Up @@ -121,11 +127,6 @@ func (st *Storer) handleDatabase(dataq *source.DataQueue) error {
}
}

err = st.ops.UpdateUserIllustsTime(ctx, resdata.UserID)
if err != nil {
st.tracer.FailTask(data.Group, err.Error())
return err
}
st.tracer.FinishTask(data.Group)
err = dataq.Ack(tag)
if err != nil {
Expand Down

0 comments on commit 8984249

Please sign in to comment.