예제 #1
0
        private static void CheckInToRemote(SiteDb SiteDb, string RemoteServerUrl, string RemoteServerUserName, string RemoteServerPassword, Guid RemoteWebSiteId, ClusterNode node)
        {
            string data = Lib.Helper.JsonHelper.Serialize(node);

            string url = RemoteServerUrl + ClusterService.ClusterSyncSettingUrl + "?siteid=" + RemoteWebSiteId.ToString();

            bool submitok = true;

            try
            {
                submitok = Kooboo.Lib.Helper.HttpHelper.PostData(url, null, System.Text.Encoding.UTF8.GetBytes(data), RemoteServerUserName, RemoteServerPassword);
            }
            catch (Exception)
            {
                submitok = false;
            }

            if (!submitok)
            {
                Sites.TaskQueue.QueueManager.Add(new TaskQueue.HttpPostStringContent()
                {
                    RemoteUrl = url, UserName = RemoteServerUserName, Password = RemoteServerPassword, StringContent = data
                }, SiteDb.WebSite.Id);
            }
        }