Skip to content

Commit 277af9e

Browse files
author
gauffininteractive
committed
Completed the background jobs.
1 parent e6fb934 commit 277af9e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/Server/OneTrueError.Data.Common/Configuration/Database/DatabaseStore.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class DatabaseStore : ConfigurationStore
1616
{
1717
private readonly Dictionary<Type, Wrapper> _items = new Dictionary<Type, Wrapper>();
1818

19-
2019
/// <summary>
2120
/// Load a settings section
2221
/// </summary>
@@ -28,7 +27,9 @@ public override T Load<T>()
2827
{
2928
Wrapper t;
3029
if (_items.TryGetValue(typeof(T), out t) && !t.HasExpired())
31-
return (T) t.Value;
30+
{
31+
return (T)t.Value;
32+
}
3233
}
3334

3435
var section = new T();
@@ -88,11 +89,11 @@ public override void Store(IConfigurationSection section)
8889
}
8990
}
9091

91-
private void SetCache<T>(T section)
92+
private void SetCache(IConfigurationSection section)
9293
{
9394
lock (_items)
9495
{
95-
_items[typeof(T)] = new Wrapper {AddedAtUtc = DateTime.UtcNow, Value = section};
96+
_items[section.GetType()] = new Wrapper {AddedAtUtc = DateTime.UtcNow, Value = section};
9697
}
9798
}
9899

src/Server/OneTrueError.Web/Areas/Admin/Controllers/ReportingController.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Web;
55
using System.Web.Mvc;
6+
using log4net;
67
using OneTrueError.App.Core.Reports.Config;
78
using OneTrueError.Infrastructure.Configuration;
89
using OneTrueError.Web.Areas.Admin.Models;
@@ -11,6 +12,8 @@ namespace OneTrueError.Web.Areas.Admin.Controllers
1112
{
1213
public class ReportingController : Controller
1314
{
15+
private ILog _logger = LogManager.GetLogger(typeof(ReportingController));
16+
1417
[HttpGet]
1518
public ActionResult Index()
1619
{
@@ -19,9 +22,10 @@ public ActionResult Index()
1922
if (settings == null || settings.MaxReportsPerIncident == 0)
2023
return View(model);
2124

25+
_logger.Debug("Display acess: " + settings.MaxReportsPerIncident + " from " + ConfigurationStore.Instance.GetHashCode());
2226
model.MaxReportsPerIncident = settings.MaxReportsPerIncident;
2327
model.RetentionDays= settings.RetentionDays;
24-
return View();
28+
return View(model);
2529
}
2630

2731
[HttpPost]
@@ -35,9 +39,11 @@ public ActionResult Index(ReportingViewModel model)
3539
MaxReportsPerIncident = model.MaxReportsPerIncident,
3640
RetentionDays = model.RetentionDays,
3741
};
42+
_logger.Debug("Storing: " + settings.MaxReportsPerIncident);
3843
ConfigurationStore.Instance.Store(settings);
44+
_logger.Debug("Stored: " + settings.MaxReportsPerIncident + " to " + ConfigurationStore.Instance.GetHashCode());
3945

40-
return View();
46+
return RedirectToAction("Index", "Home");
4147
}
4248
}
4349
}

src/Server/OneTrueError.Web/Areas/Admin/Views/Reporting/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="col-lg-6">
77

88
<h2>Base configuration</h2>
9-
<form method="post" action="@Url.Action("Basics")" style="width: 100%" class="form">
9+
<form method="post" action="@Url.Action("Index")" style="width: 100%" class="form">
1010
@Html.ValidationSummary(false)
1111
<div class="form-group">
1212
<label class="control-label">

0 commit comments

Comments
 (0)