server.address can be used to configure binding address of port 8081 and 443
Print message after proxy startup
This commit is contained in:
parent
9cd5d2db37
commit
c97ccd80ac
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
<groupId>nl.komtek</groupId>
|
<groupId>nl.komtek</groupId>
|
||||||
<artifactId>GunbotProxyCommunity</artifactId>
|
<artifactId>GunbotProxyCommunity</artifactId>
|
||||||
<version>0.9.3</version>
|
<version>0.9.4</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>GunbotProxyCommunity</name>
|
<name>GunbotProxyCommunity</name>
|
||||||
|
|
|
@ -35,6 +35,8 @@ public class Application {
|
||||||
|
|
||||||
@Value("${server.additionalPort:8081}")
|
@Value("${server.additionalPort:8081}")
|
||||||
private int additionalPort;
|
private int additionalPort;
|
||||||
|
@Value("${server.address:0.0.0.0}")
|
||||||
|
private String serverAddress;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
|
@ -75,6 +77,9 @@ public class Application {
|
||||||
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
||||||
connector.setScheme("http");
|
connector.setScheme("http");
|
||||||
connector.setPort(additionalPort);
|
connector.setPort(additionalPort);
|
||||||
|
if (!serverAddress.equals("0.0.0.0")) {
|
||||||
|
connector.setAttribute("address", serverAddress);
|
||||||
|
}
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class GunbotProxyService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info("Running in multimarket MODE!");
|
|
||||||
if (!createMarketDefaultApiClients("BTC")) {
|
if (!createMarketDefaultApiClients("BTC")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package nl.komtek.gpi.utils;
|
package nl.komtek.gpi.utils;
|
||||||
|
|
||||||
import nl.komtek.gpi.services.GunbotProxyService;
|
import nl.komtek.gpi.services.GunbotProxyService;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -11,9 +13,19 @@ import org.springframework.stereotype.Component;
|
||||||
@Component
|
@Component
|
||||||
public class ScheduledTasks {
|
public class ScheduledTasks {
|
||||||
|
|
||||||
|
private Logger logger = LogManager.getLogger(ScheduledTasks.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private GunbotProxyService gunbotProxyService;
|
private GunbotProxyService gunbotProxyService;
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay = Long.MAX_VALUE)
|
||||||
|
public void itWorks() {
|
||||||
|
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||||
|
logger.info("Running in multimarket MODE!");
|
||||||
|
}
|
||||||
|
logger.info("Good job, It works!");
|
||||||
|
}
|
||||||
|
|
||||||
@Scheduled(fixedDelay = 2000)
|
@Scheduled(fixedDelay = 2000)
|
||||||
public void updateTicker() {
|
public void updateTicker() {
|
||||||
gunbotProxyService.getTickerScheduled();
|
gunbotProxyService.getTickerScheduled();
|
||||||
|
@ -22,7 +34,7 @@ public class ScheduledTasks {
|
||||||
@Scheduled(fixedDelay = 9000)
|
@Scheduled(fixedDelay = 9000)
|
||||||
public void updateCompleteBalances() {
|
public void updateCompleteBalances() {
|
||||||
String market = "default";
|
String market = "default";
|
||||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||||
market = "BTC";
|
market = "BTC";
|
||||||
}
|
}
|
||||||
gunbotProxyService.getCompleteBalancesScheduled(market);
|
gunbotProxyService.getCompleteBalancesScheduled(market);
|
||||||
|
@ -52,7 +64,7 @@ public class ScheduledTasks {
|
||||||
@Scheduled(fixedDelay = 1500)
|
@Scheduled(fixedDelay = 1500)
|
||||||
public void updateTradeHistory() {
|
public void updateTradeHistory() {
|
||||||
String market = "default";
|
String market = "default";
|
||||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||||
market = "BTC";
|
market = "BTC";
|
||||||
}
|
}
|
||||||
gunbotProxyService.getTradeHistoryScheduled(market);
|
gunbotProxyService.getTradeHistoryScheduled(market);
|
||||||
|
@ -82,7 +94,7 @@ public class ScheduledTasks {
|
||||||
@Scheduled(fixedDelay = 2000)
|
@Scheduled(fixedDelay = 2000)
|
||||||
public void updateOpenOrders() {
|
public void updateOpenOrders() {
|
||||||
String market = "default";
|
String market = "default";
|
||||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||||
market = "BTC";
|
market = "BTC";
|
||||||
}
|
}
|
||||||
gunbotProxyService.getOpenOrdersScheduled(market);
|
gunbotProxyService.getOpenOrdersScheduled(market);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</File>
|
</File>
|
||||||
</Appenders>
|
</Appenders>
|
||||||
<Loggers>
|
<Loggers>
|
||||||
<Logger name="nl.komtek" level="error" additivity="false">
|
<Logger name="nl.komtek" level="info" additivity="false">
|
||||||
<AppenderRef ref="Console"/>
|
<AppenderRef ref="Console"/>
|
||||||
<AppenderRef ref="File"/>
|
<AppenderRef ref="File"/>
|
||||||
</Logger>
|
</Logger>
|
||||||
|
|
Loading…
Reference in New Issue