public async Task <CreateLogRecord.Request> RunCrawlers([FromServices] CreateLogRecord createLogRecord, [FromServices] CrawlersCommander crawlersCommander) { var resuest = new CreateLogRecord.Request { Message = "Crawlers Started", TimeStamp = DateTime.Now }; await createLogRecord.DoAsync(resuest); var productsFound = await crawlersCommander.RunEngineAsync(); resuest = new CreateLogRecord.Request { Message = $"Scraping Finished, products found: {productsFound}", TimeStamp = DateTime.Now }; await createLogRecord.DoAsync(resuest); return(resuest); }
public async Task <CreateLogRecord.Request> WakeUpCheck([FromServices] CreateLogRecord createLogRecord) { var resuest = new CreateLogRecord.Request { Message = "Wake Up Call", TimeStamp = DateTime.Now }; await createLogRecord.DoAsync(resuest); return(resuest); }