Merge conflicts
This commit is contained in:
@@ -24,7 +24,7 @@ namespace PartSource.Automation.Jobs
|
||||
|
||||
public BulkUpdateInventory(IConfiguration configuration, ILogger<BulkUpdateInventory> logger)
|
||||
{
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AzureConfiguration").Get<FtpConfiguration>();
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AutomationConfiguration").Get<FtpConfiguration>();
|
||||
_ftpService = new FtpService(ftpConfiguration);
|
||||
|
||||
_connectionString = configuration.GetConnectionString("PartSourceDatabase");
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PartSource.Automation.Models.Configuration;
|
||||
using PartSource.Automation.Models.Ftp;
|
||||
using PartSource.Automation.Services;
|
||||
using Ratermania.Automation.Interfaces;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -21,7 +23,7 @@ namespace PartSource.Automation.Jobs
|
||||
|
||||
public ExecuteSsisPackages(EmailService emailService, IConfiguration configuration, SsisService ssisService, ILogger<ExecuteSsisPackages> logger)
|
||||
{
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AzureConfiguration").Get<FtpConfiguration>();
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AutomationConfiguration").Get<FtpConfiguration>();
|
||||
|
||||
_emailService = emailService;
|
||||
_ftpService = new FtpService(ftpConfiguration);
|
||||
@@ -36,7 +38,18 @@ namespace PartSource.Automation.Jobs
|
||||
{
|
||||
try
|
||||
{
|
||||
_ftpService.Download($"{package}.txt");
|
||||
FtpFileInfo lastUploadedFile = _ftpService.ListFilesExtended()
|
||||
.Where(f => f.FileType == FtpFileType.File && f.Filename.IndexOf(package) > -1)
|
||||
.OrderByDescending(f => f.Modified)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (lastUploadedFile == null)
|
||||
{
|
||||
_logger.LogInformation($"No {package} file available.");
|
||||
return;
|
||||
}
|
||||
|
||||
_ftpService.Download($"{package}.txt");
|
||||
_ssisService.Execute($"{package}.dtsx");
|
||||
|
||||
_logger.LogInformation($"Execution of SSIS package {package} completed successfully.");
|
||||
@@ -45,7 +58,6 @@ namespace PartSource.Automation.Jobs
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError($"Execution of SSIS package {package} failed.", ex);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ using Ratermania.Shopify.Resources;
|
||||
|
||||
namespace PartSource.Automation.Jobs.POC
|
||||
{
|
||||
public class AlsoGetImageUrls : IAutomationJob
|
||||
public class ImageList : IAutomationJob
|
||||
{
|
||||
private readonly NexpartService _nexpartService;
|
||||
private readonly PartSourceContext _partSourceContext;
|
||||
private readonly FitmentContext _fitmentContext;
|
||||
|
||||
public AlsoGetImageUrls(NexpartService nexpartService, PartSourceContext partSourceContext, FitmentContext fitmentContext)
|
||||
public GetImageUrls(NexpartService nexpartService, PartSourceContext partSourceContext, FitmentContext fitmentContext)
|
||||
{
|
||||
_nexpartService = nexpartService;
|
||||
_partSourceContext = partSourceContext;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PartSource.Automation.Jobs
|
||||
|
||||
public PartialInventoryUpdate(IConfiguration configuration, ILogger<PartialInventoryUpdate> logger)
|
||||
{
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AzureConfiguration").Get<FtpConfiguration>();
|
||||
FtpConfiguration ftpConfiguration = configuration.GetSection("FtpServers:AutomationConfiguration").Get<FtpConfiguration>();
|
||||
_ftpService = new FtpService(ftpConfiguration);
|
||||
|
||||
_connectionString = _connectionString = configuration.GetConnectionString("PartSourceDatabase");
|
||||
|
||||
Reference in New Issue
Block a user