Radeon Reset Bug fix service
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RadeonResetBugFix/RadeonResetBugFixService/TasksProcessor.cs

35 lines
840 B

namespace RadeonResetBugFixService
{
using System;
using System.Collections.Generic;
using Contracts;
using Logging;
using Tasks;
static class TasksProcessor
{
public static void ProcessTask(ILogger logger, ITask task)
{
using (ILogger taskLogger = new TaskLoggerWrapper(logger, task.TaskName))
{
try
{
task.Run(taskLogger);
}
catch (Exception e)
{
taskLogger.LogError(e.ToString());
}
}
}
public static void ProcessTasks(ILogger logger, IEnumerable<ITask> tasks)
{
foreach (var task in tasks)
{
ProcessTask(logger, task);
}
}
}
}