the-other-tim-brown commented on code in PR #593:
URL: https://github.com/apache/incubator-xtable/pull/593#discussion_r1987778126
##########
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:
nice catch, I need to check the current thread which has an instance method
which does not clear the state
--
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]