hosting: fixed running ActivePassive instance
This commit is contained in:
parent
ab5de603c1
commit
c91711dbeb
@ -24,6 +24,8 @@
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Notify;
|
||||
|
||||
namespace ASC.Core.Common.Hosting;
|
||||
|
||||
[Scope]
|
||||
@ -48,6 +50,10 @@ public class RegisterInstanceDao<T> : IRegisterInstanceDao<T> where T : IHostedS
|
||||
if (inst == null)
|
||||
{
|
||||
await _instanceRegistrationContext.AddAsync(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
_instanceRegistrationContext.Entry(inst).CurrentValues.SetValues(obj);
|
||||
}
|
||||
|
||||
bool saveFailed;
|
||||
|
@ -60,7 +60,7 @@ public class RegisterInstanceManager<T> : IRegisterInstanceManager<T> where T :
|
||||
{
|
||||
var firstAliceInstance = GetFirstAliveInstance(instances);
|
||||
|
||||
if (firstAliceInstance != null && firstAliceInstance.InstanceRegistrationId == instance.InstanceRegistrationId)
|
||||
if (firstAliceInstance == null || firstAliceInstance.InstanceRegistrationId == instance.InstanceRegistrationId)
|
||||
{
|
||||
instance.IsActive = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user