public IJobHandler BuildBruteforce(AbstractJob job) => new BruteforceJobHandler(_krakerApi, _workedFolders.TempFolderPath, _tempFileManager, _agentIdManager.GetCurrent().Id, _speedCalculator, _logger, job as BruteforceJob, _executorBuilder);
public Agent(IJobHandlerProvider jobHandlerProvider, IAgentIdManager agentIdManager, IKrakerApi krakerApi, ILogger logger) { _switch = new FiniteStateMachine(WaitJob); _jobHandlerProvider = jobHandlerProvider; _krakerApi = krakerApi; _logger = logger; _agentId = agentIdManager.GetCurrent().Id ?? throw new InvalidOperationException("The agent needs to have id"); var incorrectJobHandler = new IncorrectJobHandler(new IncorrectJob("Haven't got any jobs")); _jobHandler = incorrectJobHandler; _incorrectJobHandler = incorrectJobHandler; }
private string GetAgentId() => _agentIdManager.GetCurrent().Id ?? throw new InvalidOperationException("The agent needs to have id");