Skip to content

Commit 5f46613

Browse files
committed
Resolve a few plugin loading and scheduler issues
1 parent 889db8b commit 5f46613

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/InEngine.Core/PluginAssembly.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ static Assembly LoadPluginEventHandler(object sender, ResolveEventArgs args)
9898
static string MakeFullPluginAssemblyPath(string pluginName)
9999
{
100100
var plugins = InEngineSettings.Make().Plugins;
101-
if (!plugins.ContainsKey(pluginName))
101+
var isCorePlugin = Assembly.GetCallingAssembly().GetName().Name == pluginName;
102+
if (!isCorePlugin && !plugins.ContainsKey(pluginName))
102103
throw new PluginNotRegisteredException(pluginName);
103-
104104
return Path.Combine(
105105
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
106-
plugins[pluginName],
106+
isCorePlugin ? "" : plugins[pluginName],
107107
$"{pluginName}.dll"
108108
);
109109
}

src/InEngine.Core/Scheduling/SuperScheduler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace InEngine.Core.Scheduling
77
{
88
public class SuperScheduler
99
{
10-
public Schedule Schedule { get; set; }
10+
public Schedule Schedule { get; set; } = new Schedule();
1111
public IScheduler Scheduler { get; set; }
1212
public string SchedulerInstanceName { get; set; } = "InEngine";
1313
public string SchedulerThreadPoolType { get; set; } = "Quartz.Simpl.SimpleThreadPool, Quartz";
@@ -23,7 +23,6 @@ public void Initialize()
2323
["quartz.threadPool.threadPriority"] = SchedulerThreadPriority
2424
}).GetScheduler();
2525

26-
Schedule = new Schedule();
2726
PluginAssembly.Load<IPlugin>().ForEach(x => {
2827
x.Plugins.ForEach(y => y.Schedule(Schedule));
2928
});

src/SampleMvcWebsite/Global.asax.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected void Application_Start()
2222

2323
protected void Application_End()
2424
{
25-
SuperScheduler.Shutdown();
25+
SuperScheduler?.Shutdown();
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)