Fix reminding for livetradingbot

This commit is contained in:
2025-09-18 12:19:52 +07:00
parent f1bb40fb75
commit ffe69356d8
8 changed files with 199 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
using Orleans;
namespace Managing.Application.Abstractions.Grains;
/// <summary>
/// Grain responsible for initializing bot reminders on application startup.
/// This grain ensures that only one instance runs the initialization process
/// even in multi-silo environments.
/// </summary>
public interface IBotReminderInitializerGrain : IGrainWithIntegerKey
{
/// <summary>
/// Initializes bot reminders by fetching all running bots and pinging them
/// to ensure their reminders are properly registered.
/// </summary>
Task InitializeBotRemindersAsync();
}

View File

@@ -39,4 +39,11 @@ public interface ILiveTradingBotGrain : IGrainWithGuidKey
/// Deletes the bot and cleans up all associated resources
/// </summary>
Task DeleteAsync();
/// <summary>
/// Pings the bot to reactivate it and ensure reminders are registered
/// Used during startup to reactivate bots that may have lost their reminders
/// Returns true if the ping was successful, false otherwise
/// </summary>
Task<bool> PingAsync();
}