mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Don't uninstall agent when server might be undergoing maintenance.
This commit is contained in:
parent
13e47e4d29
commit
8094820c79
@ -73,7 +73,7 @@ namespace Remotely.Server.Services
|
||||
ApiScriptResults.Set(requestID, commandID, DateTimeOffset.Now.AddHours(1));
|
||||
}
|
||||
|
||||
public Task DeviceCameOnline(Device device)
|
||||
public Task<bool> DeviceCameOnline(Device device)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -85,8 +85,7 @@ namespace Remotely.Server.Services
|
||||
OrganizationID = device.OrganizationID,
|
||||
Message = $"Device connection for {device?.DeviceName} was denied because it is already connected."
|
||||
});
|
||||
Context.Abort();
|
||||
return Task.CompletedTask;
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
if (DataService.AddOrUpdateDevice(device, out var updatedDevice))
|
||||
@ -99,20 +98,22 @@ namespace Remotely.Server.Services
|
||||
.Select(x => x.Key)
|
||||
.ToList();
|
||||
|
||||
return BrowserHub.Clients.Clients(connectionIds).SendAsync("DeviceCameOnline", Device);
|
||||
BrowserHub.Clients.Clients(connectionIds).SendAsync("DeviceCameOnline", Device);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Organization wasn't found.
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// // Organization wasn't found.
|
||||
// return Clients.Caller.SendAsync("UninstallClient");
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DataService.WriteEvent(ex);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
Context.Abort();
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
public Task DeviceHeartbeat(Device device)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user