427c488cd6
Remove JDE/CMS source-system integration: JDE/CMS query classes, SQL files, WorkerService UpdateProcessor pipeline, dsconfig data-source configs, and Oracle/Sybase/DDTek driver references. WorkProcessor now goes straight to processing queued searches against the existing local SQL Server cache; DB schema (DataUpdate table, MatchMis function) is left intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
55 lines
1.9 KiB
C#
Executable File
55 lines
1.9 KiB
C#
Executable File
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using Dapper;
|
|
using DataModel;
|
|
using Topshelf;
|
|
using WorkerService.Process;
|
|
|
|
namespace WorkerService
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
string cs = Config.LotFinderDBCS;
|
|
|
|
//Load app domain assemblies
|
|
var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).ToList();
|
|
var loadedPaths = loadedAssemblies.Select(a => a.Location).ToArray();
|
|
|
|
var referencedPaths = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.dll");
|
|
var toLoad = referencedPaths.Where(r => !loadedPaths.Contains(r, StringComparer.InvariantCultureIgnoreCase)).ToList();
|
|
toLoad.ForEach(path => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(AssemblyName.GetAssemblyName(path))));
|
|
|
|
//Override defaults
|
|
SqlMapper.Settings.CommandTimeout = 1200 * 50;
|
|
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
|
|
|
|
Host host = HostFactory.New(x =>
|
|
{
|
|
x.UseNLog();
|
|
|
|
x.StartAutomatically();
|
|
x.EnableServiceRecovery(rc => { rc.RestartService(1); });
|
|
x.EnableShutdown();
|
|
|
|
x.Service<WorkProcessor>(s =>
|
|
{
|
|
s.ConstructUsing(name => new WorkProcessor());
|
|
s.WhenStarted(tc => tc.Start());
|
|
s.WhenStopped(tc => tc.Stop());
|
|
});
|
|
x.RunAsLocalSystem();
|
|
|
|
x.SetDescription("JDE scoping search processor");
|
|
x.SetDisplayName("JDE_SearchProcessor");
|
|
x.SetServiceName("JDE_SearchProcessor");
|
|
});
|
|
|
|
host.Run();
|
|
}
|
|
}
|
|
}
|