un-stopped bot return status "stopped" instead of the error
This commit is contained in:
@@ -277,7 +277,7 @@ public class LiveTradingBotGrain : Grain, ILiveTradingBotGrain, IRemindable
|
|||||||
var hasOpenPositions = await HasOpenPositionsInDatabaseAsync();
|
var hasOpenPositions = await HasOpenPositionsInDatabaseAsync();
|
||||||
if (hasOpenPositions)
|
if (hasOpenPositions)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Cannot stop strategy {Name} : strategy has open positions in database",
|
_logger.LogWarning("Stopping bot {Name} while it still has open positions in database. Trading loop will stop but positions remain managed by system.",
|
||||||
_tradingBot?.Config.Name);
|
_tradingBot?.Config.Name);
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
"Cannot stop bot while it has open positions. Please close all positions first.");
|
"Cannot stop bot while it has open positions. Please close all positions first.");
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Managing.Application.ManageBot
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_tradingBotLogger.LogError(e, "Error stopping bot {Identifier}", identifier);
|
_tradingBotLogger.LogError(e, "Error stopping bot {Identifier}", identifier);
|
||||||
return BotStatus.Stopped;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1767,7 +1767,7 @@ export class DataClient extends AuthorizedApiBase {
|
|||||||
url_ = url_.replace(/[?&]$/, "");
|
url_ = url_.replace(/[?&]$/, "");
|
||||||
|
|
||||||
let options_: RequestInit = {
|
let options_: RequestInit = {
|
||||||
method: "POST",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "application/json"
|
"Accept": "application/json"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user