diff --git a/core/Concrete/Dispatcher.cs b/core/Concrete/Dispatcher.cs index 5895f10b..ffdf1ba1 100644 --- a/core/Concrete/Dispatcher.cs +++ b/core/Concrete/Dispatcher.cs @@ -14,16 +14,17 @@ using puck.core.State; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; +using System.Collections.Concurrent; namespace puck.core.Concrete { public class Dispatcher:I_Task_Dispatcher,IHostedService,IDisposable { public Dispatcher() { - this.QueuedTasks = new HashSet(); + this.QueuedTasks = new ConcurrentDictionary(); CatchUp=PuckCache.TaskCatchUp; } - private HashSet QueuedTasks { get; set; } + private ConcurrentDictionary QueuedTasks { get; set; } System.Timers.Timer tmr; private static object lck= new object(); int lock_wait = 100; @@ -51,7 +52,8 @@ public void OnTaskEnd(BaseTask t){ } public void HandleTaskEnd(object s, DispatchEventArgs e){ - QueuedTasks.Remove(e.Task.ID); + int removedId=0; + QueuedTasks.Remove(e.Task.ID,out removedId); if (!e.Task.Recurring) { Tasks.Remove(e.Task); @@ -82,9 +84,9 @@ public void Dispatch(object sender, EventArgs e) { return; foreach (var t in Tasks) { - if (ShouldRunNow(t)&&!QueuedTasks.Contains(t.ID)) + if (ShouldRunNow(t)&&!QueuedTasks.ContainsKey(t.ID)) { - QueuedTasks.Add(t.ID); + QueuedTasks.TryAdd(t.ID,t.ID); System.Threading.Tasks.Task.Factory.StartNew(() => { t.DoRun(this.cancellationToken); }, cancellationToken); diff --git a/core/core.csproj b/core/core.csproj index 819437a5..97a4db6e 100644 --- a/core/core.csproj +++ b/core/core.csproj @@ -55,6 +55,7 @@ + diff --git a/puckweb/Areas/puck/Views/Api/Audit.cshtml b/puckweb/Areas/puck/Views/Api/Audit.cshtml index d6adf237..16f99be6 100644 --- a/puckweb/Areas/puck/Views/Api/Audit.cshtml +++ b/puckweb/Areas/puck/Views/Api/Audit.cshtml @@ -49,7 +49,7 @@ @Html.DisplayFor(modelItem => item.Username) - @item.Timestamp.ToString("dd/MM/yyyy mm:ss") + @item.Timestamp.ToString("dd/MM/yyyy HH:mm:ss") @Html.DisplayFor(modelItem => item.Notes) diff --git a/puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js b/puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js index 239cbbff..22c32985 100644 --- a/puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js +++ b/puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js @@ -1130,6 +1130,7 @@ var overlay = function (el, width, height, top, title, isRightSided) { cright.append(outer); if (!isRightSided) outer.animate({ width: width + (width.toString().indexOf("%") > -1 ? "" : "px") }, 200, function () { if (f) f(); afterDom(); }); + else afterDom(); if ($(".overlay_screen.active").length == 1) { $(document).off("keyup.overlay").on("keyup.overlay", function (e) { if (e.keyCode == 27) { overlayClose(cleftIsVisible, overlayClass); }