Showing
1 changed file
with
10 additions
and
10 deletions
@@ -31,22 +31,22 @@ public class FailTradeBillsScanner implements Runnable { | @@ -31,22 +31,22 @@ public class FailTradeBillsScanner implements Runnable { | ||
31 | 31 | ||
32 | @Override | 32 | @Override |
33 | public void run() { | 33 | public void run() { |
34 | - try { | ||
35 | - // Need to catch the exception to keep the event scanner running. | ||
36 | - pollEvents(); | ||
37 | - } catch (Exception ex) { | ||
38 | - log.warn("Got the exception {} when poll.", ex.getMessage(), ex); | ||
39 | - } | ||
40 | - } | ||
41 | - | ||
42 | - private void pollEvents() { | ||
43 | scheduler.scheduleWithFixedDelay( | 34 | scheduler.scheduleWithFixedDelay( |
44 | - () -> recoverFailTradeBills(), | 35 | + () -> pollEvents(), |
45 | 0, | 36 | 0, |
46 | pollingInterval, | 37 | pollingInterval, |
47 | MILLISECONDS); | 38 | MILLISECONDS); |
48 | } | 39 | } |
49 | 40 | ||
41 | + private void pollEvents() { | ||
42 | + try { | ||
43 | + recoverFailTradeBills(); | ||
44 | + } catch (Exception ex) { | ||
45 | + // Need to catch the exception to keep the event scanner running. | ||
46 | + log.warn("Got the exception {} when poll.", ex.getMessage(), ex); | ||
47 | + } | ||
48 | + } | ||
49 | + | ||
50 | private void recoverFailTradeBills() { | 50 | private void recoverFailTradeBills() { |
51 | List<TradeBills> failTradeBillsList = tradeBillsMapper.selectByFailTradeBills(fromCreateTime, fromTradeBillsId, 1); | 51 | List<TradeBills> failTradeBillsList = tradeBillsMapper.selectByFailTradeBills(fromCreateTime, fromTradeBillsId, 1); |
52 | if (CollectionUtils.isEmpty(failTradeBillsList)) { | 52 | if (CollectionUtils.isEmpty(failTradeBillsList)) { |
-
Please register or login to post a comment