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>
|
||||
<artifactId>GunbotProxyCommunity</artifactId>
|
||||
<version>0.9.3</version>
|
||||
<version>0.9.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>GunbotProxyCommunity</name>
|
||||
|
|
|
@ -35,6 +35,8 @@ public class Application {
|
|||
|
||||
@Value("${server.additionalPort:8081}")
|
||||
private int additionalPort;
|
||||
@Value("${server.address:0.0.0.0}")
|
||||
private String serverAddress;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
|
@ -75,6 +77,9 @@ public class Application {
|
|||
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
||||
connector.setScheme("http");
|
||||
connector.setPort(additionalPort);
|
||||
if (!serverAddress.equals("0.0.0.0")) {
|
||||
connector.setAttribute("address", serverAddress);
|
||||
}
|
||||
return connector;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,6 @@ public class GunbotProxyService {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
logger.info("Running in multimarket MODE!");
|
||||
if (!createMarketDefaultApiClients("BTC")) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package nl.komtek.gpi.utils;
|
||||
|
||||
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.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -11,9 +13,19 @@ import org.springframework.stereotype.Component;
|
|||
@Component
|
||||
public class ScheduledTasks {
|
||||
|
||||
private Logger logger = LogManager.getLogger(ScheduledTasks.class);
|
||||
|
||||
@Autowired
|
||||
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)
|
||||
public void updateTicker() {
|
||||
gunbotProxyService.getTickerScheduled();
|
||||
|
@ -22,7 +34,7 @@ public class ScheduledTasks {
|
|||
@Scheduled(fixedDelay = 9000)
|
||||
public void updateCompleteBalances() {
|
||||
String market = "default";
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||
market = "BTC";
|
||||
}
|
||||
gunbotProxyService.getCompleteBalancesScheduled(market);
|
||||
|
@ -52,7 +64,7 @@ public class ScheduledTasks {
|
|||
@Scheduled(fixedDelay = 1500)
|
||||
public void updateTradeHistory() {
|
||||
String market = "default";
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||
market = "BTC";
|
||||
}
|
||||
gunbotProxyService.getTradeHistoryScheduled(market);
|
||||
|
@ -82,7 +94,7 @@ public class ScheduledTasks {
|
|||
@Scheduled(fixedDelay = 2000)
|
||||
public void updateOpenOrders() {
|
||||
String market = "default";
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()){
|
||||
if (gunbotProxyService.isUsingMultipleMarkets()) {
|
||||
market = "BTC";
|
||||
}
|
||||
gunbotProxyService.getOpenOrdersScheduled(market);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</File>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Logger name="nl.komtek" level="error" additivity="false">
|
||||
<Logger name="nl.komtek" level="info" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="File"/>
|
||||
</Logger>
|
||||
|
|
Loading…
Reference in New Issue