Update Notification Refactor (#511)
* Replaced profile links to anchors so we can open in new tab if we like * Refactored how update checking works. We now explicitly check and send back on the same API. We have a weekly job that will push an update to the user. * Implemented a changelog tab * Ported over a GA fix for using ' in PR bodies. * Don't check cert for Github
This commit is contained in:
parent
0e48aeebc5
commit
2a76092566
21 changed files with 246 additions and 56 deletions
|
|
@ -7,27 +7,30 @@ using Microsoft.AspNetCore.SignalR;
|
|||
namespace API.SignalR
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Generic hub for sending messages to UI
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class MessageHub : Hub
|
||||
{
|
||||
private static readonly HashSet<string> _connections = new HashSet<string>();
|
||||
private static readonly HashSet<string> Connections = new HashSet<string>();
|
||||
|
||||
public static bool IsConnected
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_connections)
|
||||
lock (Connections)
|
||||
{
|
||||
return _connections.Count != 0;
|
||||
return Connections.Count != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task OnConnectedAsync()
|
||||
{
|
||||
lock (_connections)
|
||||
lock (Connections)
|
||||
{
|
||||
_connections.Add(Context.ConnectionId);
|
||||
Connections.Add(Context.ConnectionId);
|
||||
}
|
||||
|
||||
await base.OnConnectedAsync();
|
||||
|
|
@ -35,9 +38,9 @@ namespace API.SignalR
|
|||
|
||||
public override async Task OnDisconnectedAsync(Exception exception)
|
||||
{
|
||||
lock (_connections)
|
||||
lock (Connections)
|
||||
{
|
||||
_connections.Remove(Context.ConnectionId);
|
||||
Connections.Remove(Context.ConnectionId);
|
||||
}
|
||||
|
||||
await base.OnDisconnectedAsync(exception);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ using Microsoft.AspNetCore.SignalR;
|
|||
|
||||
namespace API.SignalR
|
||||
{
|
||||
/// <summary>
|
||||
/// Keeps track of who is logged into the app
|
||||
/// </summary>
|
||||
public class PresenceHub : Hub
|
||||
{
|
||||
private readonly IPresenceTracker _tracker;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue