mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-14 07:44:31 +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
|
||||
}
|
||||
|
||||
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
func genRandomContentTopic(n int) string {
|
||||
topics := []string{"topic1", "topic2", "topic3", "topic4", "topic5"}
|
||||
i := n % 5
|
||||
@ -70,6 +68,10 @@ func main() {
|
||||
fmt.Println("Inserting ", N, " records in ", dbName)
|
||||
|
||||
db, err := newdb(dbName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
query := "INSERT INTO message (id, receiverTimestamp, senderTimestamp, contentTopic, pubsubTopic, payload, version) VALUES (?, ?, ?, ?, ?, ?, ?)"
|
||||
|
||||
err = createTable(db)
|
||||
|
@ -158,6 +158,11 @@ func (d *DBStore) Put(cursor *pb.Index, pubsubTopic string, message *pb.WakuMess
|
||||
return err
|
||||
}
|
||||
|
||||
err = stmt.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user