This is it. Don't get scared now. (Converted to Ratermania.Automation)
This commit is contained in:
@@ -4,19 +4,12 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PartSource.Automation.Factories;
|
||||
using PartSource.Automation.Jobs;
|
||||
using PartSource.Automation.Jobs.Interfaces;
|
||||
using PartSource.Automation.Models;
|
||||
using PartSource.Automation.Models.Configuration;
|
||||
using PartSource.Automation.Services;
|
||||
using PartSource.Data;
|
||||
using PartSource.Data.AutoMapper;
|
||||
using PartSource.Services;
|
||||
using Ratermania.Automation;
|
||||
using Ratermania.Automation.DependencyInjection;
|
||||
using Ratermania.Automation.Logging;
|
||||
using Ratermania.Shopify;
|
||||
using Ratermania.Shopify.DependencyInjection;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -26,7 +19,6 @@ namespace PartSource.Automation
|
||||
{
|
||||
class Program
|
||||
{
|
||||
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
using IHost host = CreateHostBuilder().Build();
|
||||
@@ -61,22 +53,35 @@ namespace PartSource.Automation
|
||||
|
||||
.AddAutomation(options =>
|
||||
{
|
||||
options.HasBaseInterval(new TimeSpan(0, 1, 0))
|
||||
options.HasBaseInterval(new TimeSpan(0, 15, 0))
|
||||
.HasMaxFailures(5)
|
||||
.HasJob<TestJob>(options =>
|
||||
{
|
||||
options.HasInterval(new TimeSpan(0, 5, 0));
|
||||
})
|
||||
.AddApiServer();
|
||||
//.HasJob<ProcessWhiFitment>(options => options.HasInterval(new TimeSpan(24, 0, 0)))
|
||||
//.HasJob<UpdateFitment>(options => options.HasInterval(new TimeSpan(24, 0, 0))
|
||||
// .HasDependency<ProcessWhiFitment>()
|
||||
// .StartsAt(DateTime.Today.AddHours(8))
|
||||
//)
|
||||
|
||||
.HasJob<ExecuteSsisPackages>(options =>
|
||||
options.HasInterval(new TimeSpan(24, 0, 0))
|
||||
.StartsAt(DateTime.Today.AddHours(26))
|
||||
)
|
||||
.HasJob<UpdatePricing>(options => options.HasInterval(new TimeSpan(24, 0, 0))
|
||||
.StartsAt(DateTime.Today.AddHours(27))
|
||||
.HasDependency<ExecuteSsisPackages>()
|
||||
)
|
||||
.AddApiServer(options => options.HasApiKey(Environment.GetEnvironmentVariable("AUTOMATION_API_KEY")));
|
||||
})
|
||||
|
||||
.AddSingleton<EmailService>()
|
||||
.AddSingleton<SsisService>()
|
||||
.AddSingleton<WhiSeoService>()
|
||||
|
||||
.AddAutoMapper(typeof(PartSourceProfile));
|
||||
})
|
||||
.ConfigureLogging((builder, logging) =>
|
||||
{
|
||||
logging.AddEventLog();
|
||||
|
||||
logging.AddProvider(new AutomationLoggerProvider());
|
||||
logging.ClearProviders()
|
||||
.AddProvider(new AutomationLoggerProvider());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user