Skip to content

Commit

Permalink
Merge pull request #689 from skadefro/master
Browse files Browse the repository at this point in the history
cleanup unused asyncs
  • Loading branch information
skadefro authored Aug 22, 2022
2 parents f36e4e9 + 1bb38b6 commit aec0015
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions OpenRPA.Image/ImageElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public Task Highlight(bool Blocking, System.Drawing.Color Color, TimeSpan Durati
public static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("User32.dll")]
public static extern void ReleaseDC(IntPtr hwnd, IntPtr dc);
public async Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
public Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
{
System.Threading.Thread.CurrentThread.Name = "UIHighlighter";
using (Interfaces.Overlay.OverlayWindow _overlayWindow = new Interfaces.Overlay.OverlayWindow(true))
Expand All @@ -112,7 +112,7 @@ public async Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
_overlayWindow.TopMost = true;
} while (_overlayWindow.Visible && sw.Elapsed < Duration);
_overlayWindow.Close();
return;
return Task.CompletedTask;
}
//var r = new Rectangle(Rectangle.Location, Rectangle.Size);
//IntPtr desktopPtr = GetDC(IntPtr.Zero);
Expand Down
4 changes: 2 additions & 2 deletions OpenRPA.Interfaces/UIElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public Task Highlight(bool Blocking, System.Drawing.Color Color, TimeSpan Durati
[DllImport("User32.dll")]
public static extern void ReleaseDC(IntPtr hwnd, IntPtr dc);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006")]
public async Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
public Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
{
System.Threading.Thread.CurrentThread.Name = "UIHighlighter";
using (Interfaces.Overlay.OverlayWindow _overlayWindow = new Interfaces.Overlay.OverlayWindow(true))
Expand All @@ -299,7 +299,7 @@ public async Task _Highlight(System.Drawing.Color Color, TimeSpan Duration)
System.Threading.Thread.Sleep(10);
_overlayWindow.TopMost = true;
} while (_overlayWindow.Visible && sw.Elapsed < Duration);
return;
return Task.CompletedTask;
}
//var r = new Rectangle(Rectangle.Location, Rectangle.Size);
//IntPtr desktopPtr = GetDC(IntPtr.Zero);
Expand Down
8 changes: 4 additions & 4 deletions OpenRPA.WorkItems/RobotInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ await global.webSocketClient.Watch("openrpa",
}
Log.FunctionOutdent("RobotInstance", "RobotInstance_WebSocketClient_OnOpen");
}
private async void WebSocketClient_OnClose(string reason)
private void WebSocketClient_OnClose(string reason)
{
try
{
Expand All @@ -342,10 +342,10 @@ private async void WebSocketClient_OnClose(string reason)
_ = Connect();
Log.FunctionOutdent("RobotInstance", "WebSocketClient_OnClose");
}
protected internal async void WebSocketClient_OnQueueClosed(IQueueClosedMessage message, QueueMessageEventArgs e)
protected internal void WebSocketClient_OnQueueClosed(IQueueClosedMessage message, QueueMessageEventArgs e)
{
}
private async void WebSocketClient_OnQueueMessage(IQueueMessage message, QueueMessageEventArgs e)
private void WebSocketClient_OnQueueMessage(IQueueMessage message, QueueMessageEventArgs e)
{
Log.FunctionIndent("RobotInstance", "WebSocketClient_OnQueueMessage");
Log.FunctionOutdent("RobotInstance", "WebSocketClient_OnQueueMessage");
Expand Down Expand Up @@ -481,7 +481,7 @@ public async Task LoadServerData()
Log.Debug("LoadServerData::end");
}
}
private async void onWatchEvent(string id, Newtonsoft.Json.Linq.JObject data)
private void onWatchEvent(string id, Newtonsoft.Json.Linq.JObject data)
{
try
{
Expand Down
6 changes: 4 additions & 2 deletions OpenRPA.WorkItems/WorkitemQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@ public async Task Save(bool skipOnline = false)
});
}
}
public async Task Update(IWorkitemQueue item, bool skipOnline = false)
public Task Update(IWorkitemQueue item, bool skipOnline = false)
{
GenericTools.RunUI(() =>
{
RobotInstance.instance.WorkItemQueues.UpdateItem(this, item);
});
isDirty = false;
return Task.CompletedTask;
// await Save<WorkitemQueue>(skipOnline);
}
public async Task Delete(bool skipOnline = false)
public Task Delete(bool skipOnline = false)
{
if (System.Threading.Monitor.TryEnter(RobotInstance.instance.WorkItemQueues, 1000))
{
Expand All @@ -137,6 +138,7 @@ public async Task Delete(bool skipOnline = false)
System.Threading.Monitor.Exit(RobotInstance.instance.WorkItemQueues);
}
}
return Task.CompletedTask;
}
public void ExportFile(string filepath)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenRPA/OpenRPA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Description>Base UI of OpenRPA, used as part of OpenRPA robot</Description>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/open-rpa/openrpa</PackageProjectUrl>
<Version>1.4.38</Version>
<Version>1.4.39</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>openrpa.png</PackageIcon>
<Configurations>Debug;Release;ReleaseNuget;PrepInstaller</Configurations>
Expand Down
3 changes: 0 additions & 3 deletions OpenRPA/WorkflowTrackingParticipant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ protected override void Track(TrackingRecord trackRecord, TimeSpan timeStamp)
var s = ms / 1000;
RobotInstance.meter_activities?.Record(s, _tags);
span?.Dispose();
} else
{
var b = true;
}
}
}
Expand Down

0 comments on commit aec0015

Please sign in to comment.