mirror of
https://github.com/fiodarsazanavets/aspire-13-examples.git
synced 2026-06-20 12:23:14 +00:00
Add the infinite loop for the location updater
This commit is contained in:
@@ -9,6 +9,8 @@ public class LocationUpdater(
|
||||
protected async override Task
|
||||
ExecuteAsync(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await Task.Delay(5000, cancellationToken);
|
||||
await UpdateLocation(
|
||||
@@ -22,6 +24,7 @@ public class LocationUpdater(
|
||||
await UpdateLocation(
|
||||
51.508, -0.14, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateLocation(
|
||||
double latitude,
|
||||
|
||||
@@ -9,6 +9,8 @@ public class LocationUpdater(
|
||||
protected async override Task
|
||||
ExecuteAsync(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await Task.Delay(5000, cancellationToken);
|
||||
await UpdateLocation(
|
||||
@@ -22,6 +24,7 @@ public class LocationUpdater(
|
||||
await UpdateLocation(
|
||||
51.508, -0.14, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateLocation(
|
||||
double latitude,
|
||||
|
||||
@@ -9,6 +9,8 @@ public class LocationUpdater(
|
||||
protected async override Task
|
||||
ExecuteAsync(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await Task.Delay(5000, cancellationToken);
|
||||
await UpdateLocation(
|
||||
@@ -22,6 +24,7 @@ public class LocationUpdater(
|
||||
await UpdateLocation(
|
||||
51.508, -0.14, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateLocation(
|
||||
double latitude,
|
||||
|
||||
Reference in New Issue
Block a user