Skip to content

Commit

Permalink
filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wtks committed Aug 21, 2021
1 parent 8b386b8 commit 659cb46
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/webapp/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ func generateIsuGraphResponse(q sqlx.Queryer, jiaIsuUUID string, graphDate time.
var condition IsuCondition

// ここのQueryerはsdb相当(のはず)
rows, err := q.Queryx("SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = ? ORDER BY `timestamp` ASC", jiaIsuUUID)
rows, err := q.Queryx("SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = ? AND timestamp >= ? AND timestamp <= ? ORDER BY `timestamp` ASC", jiaIsuUUID, graphDate, graphDate.Add(24*time.Hour))
if err != nil {
return nil, fmt.Errorf("db error: %v", err)
}
Expand Down Expand Up @@ -1260,13 +1260,13 @@ func isIsuExists(jiaIsuUUID string) (bool, error) {
var (
insertQueCh = make(chan struct {
jiaIsuUUID string
params []interface{}
params []interface{}
}, 1000)
)

func insertIsuCondition() {
insertQueMap := make(map[int]*struct{
query []string
insertQueMap := make(map[int]*struct {
query []string
params []interface{}
})
for i := 0; i < len(dbShard); i++ {
Expand Down Expand Up @@ -1294,7 +1294,7 @@ func insertIsuCondition() {
}
insertQueMap[index].query = make([]string, 0, 1000)
insertQueMap[index].params = make([]interface{}, 0, 1000)
index = (index+1) % len(dbShard)
index = (index + 1) % len(dbShard)

case v := <-insertQueCh:
dbIdx := selectDBIndex(v.jiaIsuUUID)
Expand Down

0 comments on commit 659cb46

Please sign in to comment.