Skip to content

Commit 7f23ef1

Browse files
committed
Change to Task.Delay
1 parent c3ec745 commit 7f23ef1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Services/SagaManager/SagaManager/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ namespace SagaManager
1818
using Services;
1919
using Autofac.Extensions.DependencyInjection;
2020
using Autofac;
21+
using System.Threading.Tasks;
2122

2223
public class Program
2324
{
2425
public static IConfigurationRoot Configuration { get; set; }
2526

2627
public static void Main(string[] args)
2728
{
28-
StartUp();
29+
MainAsync().Wait();
30+
}
31+
32+
static async Task MainAsync()
33+
{
34+
StartUp();
2935

3036
IServiceCollection services = new ServiceCollection();
3137
var serviceProvider = ConfigureServices(services);
@@ -39,7 +45,7 @@ public static void Main(string[] args)
3945
while (true)
4046
{
4147
sagaManagerService.CheckFinishedGracePeriodOrders();
42-
System.Threading.Thread.Sleep(30000);
48+
await Task.Delay(30000);
4349
}
4450
}
4551

0 commit comments

Comments
 (0)