aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs')
-rw-r--r--plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs
index 8c32e71..65b115c 100644
--- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs
+++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/ManagedRouteStore.cs
@@ -26,6 +26,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
+using VNLib.Utils.Logging;
using VNLib.Plugins.Extensions.Loading;
using VNLib.Plugins.Extensions.Loading.Sql;
using VNLib.Plugins.Essentials.Content.Routing.Model;
@@ -33,10 +34,16 @@ using VNLib.Plugins.Essentials.Content.Routing.stores;
namespace VNLib.Plugins.Essentials.Content.Routing
{
- [ConfigurationName("store")]
+ [ConfigurationName("store", Required = false)]
internal sealed class ManagedRouteStore : IRouteStore
{
- private readonly IRouteStore _routeStore;
+ private readonly IRouteStore _routeStore = new DummyRouteStore();
+
+ //empty constructor for
+ public ManagedRouteStore(PluginBase plugin)
+ {
+ plugin.Log.Warn("Page router loaded but no route store was loaded. Routing funtionality is disabled.");
+ }
public ManagedRouteStore(PluginBase plugin, IConfigScope config)
{
@@ -60,5 +67,11 @@ namespace VNLib.Plugins.Essentials.Content.Routing
{
return _routeStore.GetAllRoutesAsync(routes, cancellation);
}
+
+ private sealed class DummyRouteStore : IRouteStore
+ {
+ public Task GetAllRoutesAsync(ICollection<Route> routes, CancellationToken cancellation)
+ => Task.CompletedTask;
+ }
}
}