Created
December 10, 2024 15:26
-
-
Save AnthonyGiretti/6ad186cb97c8936eb1931f9e63854de8 to your computer and use it in GitHub Desktop.
Example of .NET 6 in-process DurableClient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("FlowCleanupOrchestratorTimeTrigger")] | |
public async Task Run([TimerTrigger("%FlowCleanupTimeTrigger%", RunOnStartup = true)] TimerInfo myTimer, | |
[DurableClient] IDurableOrchestrationClient client) | |
{ | |
var instanceId = Guid.NewGuid().ToString(); | |
try | |
{ | |
_logger.LogInformation($"FlowCleanupOrchestratorTimeTrigger Timer trigger function activated for instanceId: {instanceId}"); | |
await client.StartNewAsync(nameof(FlowCleanupOrchestrator), instanceId); | |
} | |
catch (Exception ex) | |
{ | |
_logger.LogError(ex, $"FlowCleanupOrchestratorTimeTrigger: queue trigger function exception for instanceId: {instanceId}. Details: {ex.Message}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment