diff options
Diffstat (limited to 'mod/genprocessor/src')
-rw-r--r-- | mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java index 9996b71..7cee8b0 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java @@ -308,13 +308,34 @@ public class App { return false; } - public static void main(String[] args) { + public static void main(String[] args) throws InterruptedException { if (args.length == 0) { + args = new String[] { "gen" }; + String sleepstr = System.getenv("GENPROC_SLEEP_SEC"); + long sleepdur = (sleepstr != null)? 1000 * Long.parseLong(sleepstr): 0; + do { + try { + main2(args); + } catch (Exception e) { + LOG.error(e.toString(), e); + } + Thread.sleep(sleepdur); + } while (sleepdur > 0); + return; + } else { + main2(args); + } + } + + + public static void main2(String[] args) { + String argsStr = String.join(", ", args); + if (argsStr.contains("-h")) { LOG.info("Here are the possible args:"); LOG.info("<gen> <load>"); + return; } - String argsStr = String.join(", ", args); boolean shouldGenerate = argsStr.contains("gen") ? true : false; boolean shouldLoad = argsStr.contains("load") ? true : false; boolean shouldPackage = argsStr.contains("package") ? true : false; |