mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 01:44:14 +00:00
feat: add logs
This commit is contained in:
parent
aba4d8dad3
commit
b3ef7bbe7d
@ -47,7 +47,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
||||
2,
|
||||
TimeUnit.SECONDS);
|
||||
ContractManager.threadPool.submit(() -> {
|
||||
LOGGER.warn(
|
||||
LOGGER.info(
|
||||
"[SelfAdaptiveShardingExecutor " + meta.getContractID() + "] starting service...");
|
||||
while (running) {
|
||||
LOGGER.info("checking blocks to be executed, latest block=" +
|
||||
@ -102,16 +102,18 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
||||
|
||||
public void execute(String blockStr) {
|
||||
Block block = JsonUtil.fromJson(blockStr, Block.class);
|
||||
if (!toExecuted.containsKey(block.prevHash) &&
|
||||
!executedBlocks.contains(block.hash) &&
|
||||
block.isValid()) {
|
||||
LOGGER.info(String.format(
|
||||
"[SelfAdaptiveShardingExecutor %s] receive block %s -> %s, %d transactions, timestamp %d",
|
||||
"[SelfAdaptiveShardingExecutor %s] receive block %s -> %s," +
|
||||
" %d transactions, timestamp=%d, size=%d",
|
||||
meta.getContractID(),
|
||||
block.hash,
|
||||
block.prevHash,
|
||||
block.requests.length,
|
||||
block.timestamp));
|
||||
if (!toExecuted.containsKey(block.prevHash) &&
|
||||
!executedBlocks.contains(block.hash) &&
|
||||
block.isValid()) {
|
||||
block.timestamp,
|
||||
blockStr.length()));
|
||||
toExecuted.put(block.prevHash, block);
|
||||
synchronized (flag) {
|
||||
flag.notify();
|
||||
|
Loading…
Reference in New Issue
Block a user