server.address can be used to configure binding address of port 8081 and 443

Print message after proxy startup
This commit is contained in:
elroy 2017-07-05 09:17:40 +02:00
parent 9cd5d2db37
commit c97ccd80ac
5 changed files with 22 additions and 6 deletions

View File

@ -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>

View File

@ -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;
}
}

View File

@ -65,7 +65,6 @@ public class GunbotProxyService {
return;
}
} else {
logger.info("Running in multimarket MODE!");
if (!createMarketDefaultApiClients("BTC")) {
return;
}

View File

@ -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();

View File

@ -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>