Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

returnnil #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions webapp/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,7 @@ func getlastConditionByJIAIsuUUID(c echo.Context, uuid string) *IsuCondition {
return &last_condition
}
lastIsuConditionMapLock.RUnlock()

var lastCondition IsuCondition
err := db.Get(&lastCondition, "SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = ? ORDER BY `timestamp` DESC LIMIT 1",
uuid)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil
} else {
c.Logger().Errorf("db error: %v", err)
}
}
return &lastCondition
return nil
}

// POST /api/auth
Expand Down Expand Up @@ -1238,7 +1227,6 @@ func BulkInsertIsuCondition() {
isuConditionQueueLock.Lock()
isuConditionQueue = append(isuConditionQueue, inserts...)
isuConditionQueueLock.Unlock()
updatelastIsuConditionMap(uuids)
return
}
if err := tx.Commit(); err != nil {
Expand All @@ -1250,6 +1238,7 @@ func BulkInsertIsuCondition() {
isuConditionQueueLock.Unlock()
return
}
updatelastIsuConditionMap(uuids)
}

func updatelastIsuConditionMap(uuids []string) {
Expand Down