Пример #1
0
        /// <summary>
        /// Update the state of the current instance
        /// </summary>
        /// <param name="state"></param>
        /// <param name="mongoName"></param>
        /// <returns></returns>
        public static bool UpdateInstance(RoutingConfigRoleMongoProcessState state, string mongoName = null)
        {
            try
            {
                Instance instance = GetInstance(mongoName);

                if (instance == null)
                    return false;

                instance.State = state.ToString();
                instance.FillEndpoints(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints);

                return _tableHelperInstances.UpdateItem(instance);
            }
            catch (Exception ex)
            {
                Trace.TraceError(string.Format("MongoHelper.UpdateInstance Exception : : {0}", ex.Message));
                return false;
            }
        }
Пример #2
0
 //Temporary
 public static void RegisterInstanceOrUpdate(RoutingConfigRoleMongoProcessState instanceState, string mongoName = null)
 {
     RegisterInstanceOrUpdate(instanceState.ToString(), mongoName);
 }