線程池定時觸發

@Autowired
@Qualifier("schedulingTaskScheduler")
private TaskScheduler taskScheduler;

taskScheduler.schedule(new Runnable() {
	@Override
	public void run() {
		Span span = null;
		try {
			span = tracer.createSpan("組件名:業務名");
			//dosomething
		} catch (BusinessException e) {
			log.info("buzErr code={},msg={}", e.getCode(), e.getMessage());
		}catch (Exception e) {
			log.error("err",e);
		} finally{
			if (span != null) {
				tracer.close(span);
			}
		}
	}
}, endTime);
複製代碼
相關文章
相關標籤/搜索