mirror of
https://github.com/bisq-network/bisq-api-reference.git
synced 2026-05-01 09:10:12 +00:00
Tidy up "Here are today's completed trades" logging
This commit is contained in:
parent
44ca04af87
commit
dd2619bd3b
@ -593,11 +593,10 @@ public abstract class AbstractBot {
|
|||||||
*/
|
*/
|
||||||
protected void printTradesSummaryForTodayIfWalletIsUnlocked() {
|
protected void printTradesSummaryForTodayIfWalletIsUnlocked() {
|
||||||
try {
|
try {
|
||||||
log.info("Here are today's completed trades:");
|
|
||||||
printTradesSummaryForToday(CLOSED);
|
printTradesSummaryForToday(CLOSED);
|
||||||
} catch (StatusRuntimeException grpcException) {
|
} catch (StatusRuntimeException grpcException) {
|
||||||
if (walletIsLocked(grpcException)) {
|
if (walletIsLocked(grpcException)) {
|
||||||
log.error("Cannot retrieve trades while API daemon's wallet is locked.");
|
log.error("Cannot show today's trades while API daemon's wallet is locked.");
|
||||||
} else {
|
} else {
|
||||||
throw grpcException;
|
throw grpcException;
|
||||||
}
|
}
|
||||||
@ -614,7 +613,12 @@ public abstract class AbstractBot {
|
|||||||
var trades = getTrades(category).stream()
|
var trades = getTrades(category).stream()
|
||||||
.filter(t -> t.getDate() >= midnightToday)
|
.filter(t -> t.getDate() >= midnightToday)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
BotUtils.printTradesSummary(category, trades);
|
if (trades.isEmpty()) {
|
||||||
|
log.info("No trades have been completed today.");
|
||||||
|
} else {
|
||||||
|
log.info("Here are today's completed trades:");
|
||||||
|
BotUtils.printTradesSummary(category, trades);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -805,7 +809,6 @@ public abstract class AbstractBot {
|
|||||||
* @param maxTakeOffers the max number of offers that can be taken during bot run
|
* @param maxTakeOffers the max number of offers that can be taken during bot run
|
||||||
*/
|
*/
|
||||||
protected void maybeShutdownAfterSuccessfulSwap(int numOffersTaken, int maxTakeOffers) {
|
protected void maybeShutdownAfterSuccessfulSwap(int numOffersTaken, int maxTakeOffers) {
|
||||||
log.info("Here are today's completed trades:");
|
|
||||||
printTradesSummaryForToday(CLOSED);
|
printTradesSummaryForToday(CLOSED);
|
||||||
|
|
||||||
if (!isDryRun) {
|
if (!isDryRun) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user