From e3815adbf3cd2e1d0db1f6cbba048abaad9a8e3e Mon Sep 17 00:00:00 2001 From: Yang Chun Ung Date: Thu, 19 Dec 2024 22:51:12 +0900 Subject: [PATCH] Add synced block index --- ArenaService/ArenaService/ArenaWorker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArenaService/ArenaService/ArenaWorker.cs b/ArenaService/ArenaService/ArenaWorker.cs index b8e7d02..014b051 100644 --- a/ArenaService/ArenaService/ArenaWorker.cs +++ b/ArenaService/ArenaService/ArenaWorker.cs @@ -59,6 +59,7 @@ public async Task PrepareArenaParticipants() } var tip = _rpcClient.Tip!; + var blockIndex = tip.Index; var currentRoundData = await _rpcClient.GetRoundData(tip, cancellationToken); var participants = await _rpcClient.GetArenaParticipantsState(tip, currentRoundData, cancellationToken); var cacheKey = $"{currentRoundData.ChampionshipId}_{currentRoundData.Round}"; @@ -69,7 +70,7 @@ public async Task PrepareArenaParticipants() if (participants is null) { await _service.SetArenaParticipantsAsync(cacheKey, new List(), expiry); - _logger.LogInformation("[ArenaParticipantsWorker] participants({CacheKey}) is null. set empty list", cacheKey); + _logger.LogInformation("[ArenaParticipantsWorker] participants({CacheKey}) is null. set empty list on {BlockIndex}", cacheKey, blockIndex); return; } @@ -87,7 +88,7 @@ public async Task PrepareArenaParticipants() await _service.SetSeasonAsync(cacheKey, expiry); await _service.SetAvatarAddrAndScores(scoreCacheKey, avatarAddrAndScores, expiry); sw.Stop(); - _logger.LogInformation("[ArenaParticipantsWorker]Set Arena Cache[{CacheKey}]: {Elapsed}", cacheKey, sw.Elapsed); + _logger.LogInformation("[ArenaParticipantsWorker]Set Arena Cache[{CacheKey}] on {BlockIndex}: {Elapsed}", cacheKey, blockIndex, sw.Elapsed); }