mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-15 00:04:36 +00:00
fix: lint and unclosed prepared stmt
This commit is contained in:
parent
0c989d3d8c
commit
56c8ef705a
@ -23,8 +23,6 @@ func genRandomTimestamp(now int64, last30d int64) int64 {
|
|||||||
return rand.Int63n(last30d) + now
|
return rand.Int63n(last30d) + now
|
||||||
}
|
}
|
||||||
|
|
||||||
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
||||||
|
|
||||||
func genRandomContentTopic(n int) string {
|
func genRandomContentTopic(n int) string {
|
||||||
topics := []string{"topic1", "topic2", "topic3", "topic4", "topic5"}
|
topics := []string{"topic1", "topic2", "topic3", "topic4", "topic5"}
|
||||||
i := n % 5
|
i := n % 5
|
||||||
@ -70,6 +68,10 @@ func main() {
|
|||||||
fmt.Println("Inserting ", N, " records in ", dbName)
|
fmt.Println("Inserting ", N, " records in ", dbName)
|
||||||
|
|
||||||
db, err := newdb(dbName)
|
db, err := newdb(dbName)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
query := "INSERT INTO message (id, receiverTimestamp, senderTimestamp, contentTopic, pubsubTopic, payload, version) VALUES (?, ?, ?, ?, ?, ?, ?)"
|
query := "INSERT INTO message (id, receiverTimestamp, senderTimestamp, contentTopic, pubsubTopic, payload, version) VALUES (?, ?, ?, ?, ?, ?, ?)"
|
||||||
|
|
||||||
err = createTable(db)
|
err = createTable(db)
|
||||||
|
@ -158,6 +158,11 @@ func (d *DBStore) Put(cursor *pb.Index, pubsubTopic string, message *pb.WakuMess
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = stmt.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user