Skip to content

Commit 09a7751

Browse files
Fixed the problem where the timer only gets executed once.
1 parent 8e6c3ee commit 09a7751

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/ServiceControl/CustomChecks/RaiseCustomCheckChanges.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ void Run(object _)
3535
{
3636
var newTotal = session.Query<CustomCheck>().Count(c => c.Status == Status.Fail);
3737

38-
if (newTotal == total)
38+
if (newTotal != total)
3939
{
40-
return;
40+
bus.Publish(new TotalCustomCheckUpdated { Total = newTotal });
4141
}
42-
4342
total = newTotal;
4443
}
4544

46-
bus.Publish(new TotalCustomCheckUpdated {Total = total});
47-
4845
try
4946
{
5047
timer.Change((int)TimeSpan.FromSeconds(10).TotalMilliseconds, -1);

0 commit comments

Comments
 (0)