Skip to content

Commit

Permalink
Suppress startup task check exception #3480
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Dec 13, 2024
1 parent c639199 commit 95ad1bf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/Helpers/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ public class Startup

public static bool IsScheduled()
{
using (TaskService taskService = new TaskService())
return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName));
try
{
using (TaskService taskService = new TaskService())
return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName));
}
catch (Exception e)
{
Logger.WriteLine("Can't check startup task status: " + e.Message);
return false;
}
}

public static void ReScheduleAdmin()
Expand Down

0 comments on commit 95ad1bf

Please sign in to comment.