Skip to content

Commit 02f016f

Browse files
committed
send data for uid reset
1 parent 4615f8c commit 02f016f

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

  • subvortex/validator/neuron/src

subvortex/validator/neuron/src/main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,23 @@ async def run(self):
269269
moving_scores=self.moving_scores.copy(),
270270
)
271271

272+
# Build the list of uids reset
273+
uids_reset = np.flatnonzero(
274+
(self.moving_scores != 0) & (moving_scores == 0)
275+
)
276+
277+
# Save the new moving scores
278+
self.moving_scores = moving_scores
279+
280+
# Save in database
281+
await self.database.update_miners(miners=self.miners)
282+
btul.logging.debug(f"Saved miners #{len(self.miners)}")
283+
272284
# Log event that have been reset if there are any
273-
uids_reset = np.flatnonzero((self.moving_scores != 0) & (moving_scores == 0))
274285
if uids_reset.size > 0:
275286
log_event(self, uids_reset)
276287
btul.logging.debug(f"UIDs reset: {uids_reset.tolist()}")
277288

278-
# Save the new moving scores
279-
self.moving_scores = moving_scores
280-
281289
# Save in database
282290
await self.database.update_miners(miners=self.miners)
283291
btul.logging.debug(f"Saved miners #{len(self.miners)}")

0 commit comments

Comments
 (0)