clear openorders and balances cache properly

This commit is contained in:
elroy 2017-07-04 21:27:03 +02:00
parent 7dbae5cf37
commit 9cd5d2db37
1 changed files with 8 additions and 4 deletions

View File

@ -251,7 +251,8 @@ public class GunbotProxyService {
return result;
}
@Caching(evict = {@CacheEvict(value = "openOrders"), @CacheEvict(value = "completeBalances")})
@Caching(evict = {@CacheEvict(value = "openOrders", allEntries = true),
@CacheEvict(value = "completeBalances", allEntries = true)})
public String cancelOrder(String key, String orderNumber) {
logger.debug("Canceling an order");
PoloniexTradingAPIClient tmpTradingAPIClient;
@ -268,7 +269,8 @@ public class GunbotProxyService {
return result;
}
@Caching(evict = {@CacheEvict(value = "openOrders"), @CacheEvict(value = "completeBalances")})
@Caching(evict = {@CacheEvict(value = "openOrders", allEntries = true),
@CacheEvict(value = "completeBalances", allEntries = true)})
public synchronized String buyOrder(String key, String currencyPair, BigDecimal buyPrice, BigDecimal amount) {
PoloniexTradingAPIClient tmpTradingAPIClient;
if (isUsingMultipleMarkets()) {
@ -285,7 +287,8 @@ public class GunbotProxyService {
}
@Cacheable(value = "buyOrderProtection", key = "#currencyPair")
@Caching(evict = {@CacheEvict(value = "openOrders"), @CacheEvict(value = "completeBalances")})
@Caching(evict = {@CacheEvict(value = "openOrders", allEntries = true),
@CacheEvict(value = "completeBalances", allEntries = true)})
public synchronized String buyOrderWithProtection(String key, String currencyPair, BigDecimal buyPrice, BigDecimal amount) {
PoloniexTradingAPIClient tmpTradingAPIClient;
if (isUsingMultipleMarkets()) {
@ -301,7 +304,8 @@ public class GunbotProxyService {
return result;
}
@Caching(evict = {@CacheEvict(value = "openOrders"), @CacheEvict(value = "completeBalances")})
@Caching(evict = {@CacheEvict(value = "openOrders", allEntries = true),
@CacheEvict(value = "completeBalances", allEntries = true)})
public synchronized String sellOrder(String key, String currencyPair, BigDecimal buyPrice, BigDecimal amount) {
PoloniexTradingAPIClient tmpTradingAPIClient;
if (isUsingMultipleMarkets()) {