summaryrefslogtreecommitdiffstats
path: root/mod/genprocessor/src
diff options
context:
space:
mode:
authorAndrew Gauld <agauld@att.com>2020-01-21 14:47:38 +0000
committerAndrew Gauld <agauld@att.com>2020-01-21 19:41:32 +0000
commit3fb91dc34bcde5489681f6470cae7f01c8b246d0 (patch)
tree8c6a330a1dc1084c8ff99ee4e418838fe9ecfbd8 /mod/genprocessor/src
parent86a040e87585d176dee6f215d5d46a2a74c1366e (diff)
runtimeapi & genprocessor pom.xml docker changes
Change-Id: I1595bf1c08dae161530c4dcdbc3e53b909164a10 Issue-ID: DCAEGEN2-1860 Signed-off-by: Andrew Gauld <agauld@att.com>
Diffstat (limited to 'mod/genprocessor/src')
-rw-r--r--mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java25
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;