Skip to content

Commit

Permalink
exit code 137
Browse files Browse the repository at this point in the history
  • Loading branch information
lorensr committed Mar 30, 2024
1 parent c15d314 commit ce8a6d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SignalsQueries/LoyaltyProgram.workflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public async Task NotifyPurchaseAsync(int purchaseTotalCents)

if (Points >= 10_000)
{
Points -= 10_000;
await Workflow.ExecuteActivityAsync(
() => MyActivities.SendCoupon(userId),
new() { ScheduleToCloseTimeout = TimeSpan.FromMinutes(5) });
Points -= 10_000;
}
}
}
1 change: 1 addition & 0 deletions src/SignalsQueries/MyActivities.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TemporalioSamples.SignalsQueries;

using Microsoft.Extensions.Logging;
using Temporalio.Activities;

public class MyActivities
Expand Down
5 changes: 4 additions & 1 deletion src/SignalsQueries/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ async Task RunWorkerAsync()

async Task ExecuteWorkflowAsync()
{
// If the workflow is already running from a previous run, terminate it
await client.GetWorkflowHandle("signals-queries-workflow-id").TerminateAsync();

Console.WriteLine("Executing workflow");
var handle = await client.StartWorkflowAsync(
(LoyaltyProgram wf) => wf.RunAsync("user-id-123"),
Expand All @@ -52,7 +55,7 @@ async Task ExecuteWorkflowAsync()
await handle.SignalAsync(wf => wf.NotifyPurchaseAsync(3_000));

var points = await handle.QueryAsync(wf => wf.Points);
Console.WriteLine("Remaining points: {Points}", points);
Console.WriteLine("Remaining points: {0}", points);
}

switch (args.ElementAtOrDefault(0))
Expand Down

0 comments on commit ce8a6d3

Please sign in to comment.