mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-28 07:35:56 +00:00
deploy: 5e85eecd14d51279a42bd513b9a9044de381d19b
This commit is contained in:
parent
ab380702d4
commit
820592766c
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az453-266:
|
||||
# Libtool was configured on host fv-az132-410:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
@ -100,6 +100,12 @@ proc init*(T: type WakuMessageStore, db: SqliteDatabase, storeCapacity: int = 50
|
||||
let numMessages = messageCount(db).get()
|
||||
debug "number of messages in sqlite database", messageNum=numMessages
|
||||
|
||||
# add index on receiverTimestamp
|
||||
let addIndexStmt = "CREATE INDEX IF NOT EXISTS i_rt ON " & TABLE_TITLE & "(receiverTimestamp);"
|
||||
let resIndex = db.query(addIndexStmt, proc(s: ptr sqlite3_stmt) = discard)
|
||||
if resIndex.isErr:
|
||||
return err("Could not establish index on receiverTimestamp: " & resIndex.error)
|
||||
|
||||
let storeMaxLoad = int(float(storeCapacity) * MaxStoreOverflow)
|
||||
let deleteWindow = int(float(storeMaxLoad - storeCapacity) / 2)
|
||||
let wms = WakuMessageStore(database: db,
|
||||
|
Loading…
x
Reference in New Issue
Block a user