Automation and Shopify library updates
This commit is contained in:
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Automation.Jobs
|
||||
@@ -39,11 +40,11 @@ namespace PartSource.Automation.Jobs
|
||||
_noteDictionary = new ConcurrentDictionary<string, string>();
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler", Justification = "<Pending>")]
|
||||
public async Task Run()
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2008:Do not create tasks without passing a TaskScheduler", Justification = "Not library code")]
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
_whiSeoService.TruncateFitmentTables();
|
||||
// _whiSeoService.GetFiles(_seoDataType);
|
||||
_whiSeoService.GetFiles(_seoDataType);
|
||||
|
||||
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
||||
@@ -55,7 +56,7 @@ namespace PartSource.Automation.Jobs
|
||||
fileGroups.Enqueue(fileGroup);
|
||||
}
|
||||
|
||||
Task[] taskArray = new Task[8];
|
||||
Task[] taskArray = new Task[Environment.ProcessorCount / 2];
|
||||
|
||||
for (int i = 0; i < taskArray.Length; i++)
|
||||
{
|
||||
@@ -90,7 +91,7 @@ namespace PartSource.Automation.Jobs
|
||||
_logger.LogInformation($"Created fitment table for part group {fitmentTable}.");
|
||||
|
||||
}
|
||||
});
|
||||
}, token);
|
||||
}
|
||||
|
||||
Task.WaitAll(taskArray);
|
||||
|
||||
Reference in New Issue
Block a user