فهرست منبع

Z991239-5349 #comment fea: change cef running mode to multi-process

chenliangyu 1 سال پیش
والد
کامیت
760c08745b

+ 2 - 2
Framework/RvcLogSdk/log_producer_sender.c

@@ -22,7 +22,7 @@ const char* LOGE_WRITE_QUOTA_EXCEED = "WriteQuotaExceed";
 const char* LOGE_SHARD_WRITE_QUOTA_EXCEED = "ShardWriteQuotaExceed";
 const char* LOGE_TIME_EXPIRED = "RequestTimeExpired";
 
-#define SEND_SLEEP_INTERVAL_MS 100
+#define SEND_SLEEP_INTERVAL_MS 50
 #define MAX_NETWORK_ERROR_SLEEP_MS 3000
 #define BASE_NETWORK_ERROR_SLEEP_MS 300
 #define MAX_QUOTA_ERROR_SLEEP_MS 10000
@@ -261,7 +261,7 @@ void * log_producer_send_fun(void * param)
             }
         }
 
-        sleepMs = log_producer_on_send_done(send_param, rst, &error_info);//执行senddone,删除数据库中内容
+        sleepMs = log_producer_on_send_done(send_param, rst, &error_info) / 2;//执行senddone,删除数据库中内容
 
         post_log_result_destroy(rst);
 

+ 4 - 4
Module/mod_chromium/CModTools.cpp

@@ -450,7 +450,7 @@ namespace Chromium {
 			strCmdLine.Append(" --enable-media-stream=1 --enable-speech-input=1");
 		if (g_withConsole)
 			strCmdLine.Append(" --with-console");
-        strCmdLine.Append(" --no-sandbox --single-process");
+        strCmdLine.Append(" --no-sandbox");
         strCmdLine.Append(" --hide-controls");
         strCmdLine.Append(" --hide-tabs");
         strCmdLine.Append(" --logextend=").Append((+PAGE_TYPE::Ad)._to_string());
@@ -476,7 +476,7 @@ namespace Chromium {
             .Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
         //strCmdLine.Append(" --hide-controls=true")
         strCmdLine.Append(" --cache-path=").Append(cachePath);
-        strCmdLine.Append(" --no-sandbox --single-process");
+        strCmdLine.Append(" --no-sandbox");
         strCmdLine.Append(" --hide-controls");
         if (g_useMagic)
             strCmdLine.Append(" --magic-str=").Append(m_magicStr.c_str());
@@ -518,7 +518,7 @@ namespace Chromium {
 		this->m_pEntity->GetFunction()->GetPath("Temp", cachePath);
 		cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("cefCache_").Append(m_strCacheHead.length() > 0 ? m_strCacheHead.c_str() : "").Append((+ERR_PAGE_REASON::Ad)._to_string());
 		strCmdLine.Append(" --cache-path=").Append(cachePath);
-		strCmdLine.Append(" --no-sandbox --single-process");
+		strCmdLine.Append(" --no-sandbox");
 		strCmdLine.Append(" --hide-controls");
 		strCmdLine.Append(" --lang=zh-CN");//install page need language chinese
 		strCmdLine.Append(" --hide-tabs");
@@ -538,7 +538,7 @@ namespace Chromium {
         cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("cefCache_").Append(m_strCacheHead.length() > 0 ? m_strCacheHead.c_str() : "").Append(m_specialPage_temp_name.c_str());
         //strCmdLine.Append(" --hide-controls=true")
         strCmdLine.Append(" --cache-path=").Append(cachePath);
-        strCmdLine.Append(" --no-sandbox --single-process");
+        strCmdLine.Append(" --no-sandbox");//don't use single-process, it will affect the cef log
         strCmdLine.Append(" --hide-controls");
         if (g_useMagic)
             strCmdLine.Append(" --magic-str=").Append(m_magicStr.c_str());

+ 10 - 0
Module/mod_chromium/baseEx.cpp

@@ -246,6 +246,7 @@ DWORD SaveCefclientLog(std::string magicStr)
 		cur.set_unrestricted();
 		message_queue mq(create_only, dstGuid.c_str(), 100, sizeof(cefclientLog), cur);
 		g_useMagic = true;
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SaveCefclientLog thread begin");
 		while (true)
 		{
 			cefclientLog t_data;
@@ -257,7 +258,15 @@ DWORD SaveCefclientLog(std::string magicStr)
 			unsigned int t_priority = 0;
 			mq.receive(&t_data, sizeof(cefclientLog), t_recvSize, t_priority);
 			std::string source = std::string(t_data.m_filename) + "(" + std::to_string((ULONGLONG)t_data.m_filePos) + ")";
+#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
+			DbgWithLink(t_data.m_level, t_data.m_type).withLogProducer(logProducer).setSourceType(source.c_str()).withExtendLog(true).setResultMsg(t_data.m_cefLog)();
+#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
+			DbgWithLink(t_data.m_level, t_data.m_type).withLogProducer(logProducer).setSourceType(source.c_str()).withExtendLog(true).setResultMsg(t_data.m_cefLog)();
+#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
 			DbgWithLink(t_data.m_level, t_data.m_type).withLogProducer(logProducer).setSourceType(source.c_str()).withExtendLog(false).setResultMsg(t_data.m_cefLog)();
+#else
+			DbgWithLink(t_data.m_level, t_data.m_type).withLogProducer(logProducer).setSourceType(source.c_str()).withExtendLog(true).setResultMsg(t_data.m_cefLog)();
+#endif // DEVOPS
 			if (sizeof(cefclientLog) != t_recvSize)
 				break;
 			/*特么制品库太恶心了
@@ -269,6 +278,7 @@ DWORD SaveCefclientLog(std::string magicStr)
 			DbgWithLink(tmp.m_level, tmp.m_type).setSourceType(source.c_str())(tmp.m_cefLog.c_str());
 			*/
 		}
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SaveCefclientLog thread end");
 	}
 	catch (interprocess_exception& ex) {
 		message_queue::remove(dstGuid.c_str());

+ 1 - 1
addin/cmake/DependencyConanFiles.cmake

@@ -69,7 +69,7 @@ if(MSVC)
 			#mod_chromium
 			CEFControl/1.0@LR04.02_ThirdParty/testing
 			#mod_chromium
-			cefclient_mutable/2.0.19@LR04.02_ThirdParty/testing
+			cefclient_mutable/2.0.23@LR04.02_ThirdParty/testing
 			#libaudiorender
 			speex/1.2.1@LR04.02_ThirdParty/testing
 			#libvideoframework