|
|
@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -156,10 +157,13 @@ public class SyncService {
|
|
|
schedule.setShowDate(DateTimeUtils.toLocalDate(s.getShowDate(), "yyyy-MM-dd"));
|
|
|
}
|
|
|
scheduleList.add(schedule);
|
|
|
- new Thread(() -> {
|
|
|
- scheduleRepo.saveAll(scheduleList);
|
|
|
- }).start();
|
|
|
+ saveSchedule(scheduleList);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ @Async
|
|
|
+ public void saveSchedule(List<Schedule> list) {
|
|
|
+ scheduleRepo.saveAll(list);
|
|
|
+ }
|
|
|
}
|