From e95b04b2c7f62b1b74be35fa2115bb90ae300d46 Mon Sep 17 00:00:00 2001
From: elroy <elroy@symbaloo.com>
Date: Sun, 2 Jul 2017 22:20:49 +0200
Subject: [PATCH] Some delay tweaks and created bat file to start the
 application instead of using application.properties

---
 pom.xml                                        |  2 +-
 .../nl/komtek/gpi/application/Application.java |  7 +++++++
 .../gpi/services/GunbotProxyService.java       |  4 ++--
 start-application.bat                          | 18 ++++++++++++++++++
 4 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 start-application.bat

diff --git a/pom.xml b/pom.xml
index 8bbb392..dc30cac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
     <groupId>nl.komtek</groupId>
     <artifactId>GunbotProxyCommunity</artifactId>
-    <version>0.9.0</version>
+    <version>0.9.2</version>
     <packaging>jar</packaging>
 
     <name>GunbotProxyCommunity</name>
diff --git a/src/main/java/nl/komtek/gpi/application/Application.java b/src/main/java/nl/komtek/gpi/application/Application.java
index 0f2e105..8e79cb1 100644
--- a/src/main/java/nl/komtek/gpi/application/Application.java
+++ b/src/main/java/nl/komtek/gpi/application/Application.java
@@ -15,8 +15,10 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.task.SimpleAsyncTaskExecutor;
+import org.springframework.scheduling.TaskScheduler;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.concurrent.ConcurrentTaskScheduler;
 
 import java.util.concurrent.Executor;
 
@@ -56,6 +58,11 @@ public class Application {
 		return new SimpleAsyncTaskExecutor();
 	}
 
+	@Bean
+	public TaskScheduler taskScheduler() {
+		return new ConcurrentTaskScheduler();
+	}
+
 	@Bean
 	public EmbeddedServletContainerFactory servletContainer() {
 		TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
diff --git a/src/main/java/nl/komtek/gpi/services/GunbotProxyService.java b/src/main/java/nl/komtek/gpi/services/GunbotProxyService.java
index b9b73c8..b5a444e 100644
--- a/src/main/java/nl/komtek/gpi/services/GunbotProxyService.java
+++ b/src/main/java/nl/komtek/gpi/services/GunbotProxyService.java
@@ -76,8 +76,8 @@ public class GunbotProxyService {
 
 		retryPolicy = new RetryPolicy()
 				.retryOn(failure -> failure instanceof Exception)
-				.withDelay(300, TimeUnit.MILLISECONDS)
-				.withMaxRetries(10);
+				.withDelay(500, TimeUnit.MILLISECONDS)
+				.withMaxRetries(6);
 	}
 
 	//@Cacheable(value = "BBChartData", key = "#currencyPair")
diff --git a/start-application.bat b/start-application.bat
new file mode 100644
index 0000000..15e54f7
--- /dev/null
+++ b/start-application.bat
@@ -0,0 +1,18 @@
+set sp=--server.port=443
+set sks=--server.ssl.key-store=classpath:poloniex.keystore
+set sksp=--server.ssl.key-store-password=poloniex
+set skp=--server.ssl.key-password=poloniex
+set gbl=--gunbot.location=file://C:/Users/Elroy/OneDrive/Documents/GUNBOT_v3.3.2
+
+set lnl=--logging.level.nl.komtek=DEBUG
+
+REM This apiKey pair will do all the heavy lifting
+set da=--default_apiKey=first api key
+set ds=--default_apiSecret=your secret
+
+REM This apiKey will do the buying and selling and orders canceling stuff. You can add more if you have lots of pairs buying and selling
+set a=--apiKey1=another apiKey
+set as=--apiSecret1=your secret
+
+java -jar GunbotProxyCommunity-0.9.2.jar %sp% %sks% %sksp% %skp% %da% %ds% %a% %as% %lnl%
+pause