mirror of
https://github.com/logos-storage/logos-storage-network-crawler.git
synced 2026-01-03 05:53:07 +00:00
Updates todo metric when items are removed
This commit is contained in:
parent
e8ec737285
commit
a7367c2205
@ -49,6 +49,7 @@ method pop*(t: TodoList): Future[?!Nid] {.async: (raises: []), base.} =
|
||||
|
||||
let item = t.nids[0]
|
||||
t.nids.del(0)
|
||||
t.metrics.setTodoNodes(t.nids.len)
|
||||
|
||||
return success(item)
|
||||
|
||||
|
||||
@ -58,7 +58,6 @@ suite "TodoList":
|
||||
|
||||
test "nodesExpired event updates todo metric":
|
||||
await fireNodesExpiredEvent(@[nid])
|
||||
let item = (await todo.pop).tryGet()
|
||||
|
||||
check:
|
||||
metrics.todo == 1
|
||||
@ -73,3 +72,11 @@ suite "TodoList":
|
||||
check:
|
||||
popFuture.finished
|
||||
popFuture.value.tryGet() == nid
|
||||
|
||||
test "pop updates todo metric":
|
||||
await fireNewNodesDiscoveredEvent(@[nid])
|
||||
|
||||
discard (await todo.pop()).tryGet()
|
||||
|
||||
check:
|
||||
metrics.todo == 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user