vinishjail97 commented on code in PR #593:
URL: https://github.com/apache/incubator-xtable/pull/593#discussion_r1987772434
##########
xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java:
##########
@@ -115,11 +132,39 @@ public static void main(String[] args) throws IOException
{
return;
}
- DatasetConfig datasetConfig = new DatasetConfig();
+ if (cmd.hasOption(CONTINUOUS_MODE)) {
+ ScheduledExecutorService executorService =
Executors.newScheduledThreadPool(1);
+ long intervalInSeconds =
Long.parseLong(cmd.getOptionValue(CONTINUOUS_MODE_INTERVAL, "5"));
+ executorService.scheduleAtFixedRate(
+ () -> {
+ try {
+ runSync(cmd);
+ } catch (IOException ex) {
+ log.error("Sync operation failed", ex);
+ }
+ },
+ 0,
+ intervalInSeconds,
+ TimeUnit.SECONDS);
+ while (!Thread.interrupted()) {
Review Comment:
This method clears the interrupted status for the thread, do we need that
here ?
`Thread.currentThread().isInterrupted(false)` doesn't clear the interrupted
state after the check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]