Skip to content

Commit

Permalink
chore: Minor enhancements (#2789)
Browse files Browse the repository at this point in the history
* archive.nim: reduce the database report interval from 1 to 30 min
  This counts the number of rows with "select count(1) from messages"
  which is quite intense and we shouldn't run it every minute
* aside cleanup
  • Loading branch information
Ivansete-status authored and rymnc committed Jun 20, 2024
1 parent a3b422f commit ad3ad3b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion apps/networkmonitor/networkmonitor_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ proc parseCmdArg*(T: type EthRpcUrl, s: string): T =
var wsPattern =
re2"^(wss?):\/\/((localhost)|([\w_-]+(?:(?:\.[\w_-]+)+)))(:[0-9]{1,5})?([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])*"
if regex.match(s, wsPattern):
echo "here"
raise newException(
ValueError, "Websocket RPC URL is not supported, Please use an HTTP URL"
)
Expand Down
2 changes: 1 addition & 1 deletion waku/waku_archive/archive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const
WakuArchiveDefaultRetentionPolicyInterval* = chronos.minutes(30)

# Metrics reporting
WakuArchiveDefaultMetricsReportInterval* = chronos.minutes(1)
WakuArchiveDefaultMetricsReportInterval* = chronos.minutes(30)

# Message validation
# 20 seconds maximum allowable sender timestamp "drift"
Expand Down
2 changes: 0 additions & 2 deletions waku/waku_archive/driver/sqlite_driver/sqlite_driver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ method getMessagesV2*(
maxPageSize = DefaultPageSize,
ascendingOrder = true,
): Future[ArchiveDriverResult[seq[ArchiveRow]]] {.async, deprecated.} =
echo "here"

let cursor = cursor.map(toDbCursor)

let rowsRes = s.db.selectMessagesByHistoryQueryWithLimit(
Expand Down

0 comments on commit ad3ad3b

Please sign in to comment.