| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigInteger; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "chain-listener", havingValue = "true") |
| | | public class ChainRunner implements ApplicationRunner { |
| | | |
| | | |
| | |
| | | block = (BigInteger) incrementObj; |
| | | } |
| | | |
| | | BigInteger section = BigInteger.valueOf(50); |
| | | BigInteger section = BigInteger.valueOf(5000); |
| | | BigInteger subtract = newest.subtract(block); |
| | | log.info("监听:[{} - {} - {}]", newest,block,newest.subtract(block).compareTo(section) > -1); |
| | | while (newest.subtract(block).compareTo(section) > -1) { |