Skip to content

Commit

Permalink
Add synced block index
Browse files Browse the repository at this point in the history
  • Loading branch information
ipdae committed Dec 19, 2024
1 parent ebcba9b commit e3815ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ArenaService/ArenaService/ArenaWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand All @@ -69,7 +70,7 @@ public async Task PrepareArenaParticipants()
if (participants is null)
{
await _service.SetArenaParticipantsAsync(cacheKey, new List<ArenaParticipant>(), 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;
}

Expand All @@ -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);
}


Expand Down

0 comments on commit e3815ad

Please sign in to comment.