diff --git a/frameworks/ans/core/common/include/ans_const_define.h b/frameworks/ans/core/common/include/ans_const_define.h index 9d842d285bdde4f22acb818e398e2f356fd4ad90..fccaf1925e930f6d45868ab22e4be6318ab49817 100644 --- a/frameworks/ans/core/common/include/ans_const_define.h +++ b/frameworks/ans/core/common/include/ans_const_define.h @@ -27,7 +27,7 @@ namespace Notification { // Max active notification number constexpr uint32_t MAX_ACTIVE_NUM = 1000; constexpr uint32_t MAX_ACTIVE_NUM_PERAPP = 100; -constexpr uint32_t MAX_ACTIVE_NUM_PERSECOND = 10; +constexpr uint32_t MAX_ACTIVE_NUM_PERSECOND = 3; constexpr uint32_t MAX_SLOT_NUM = 5; constexpr uint32_t MAX_SLOT_GROUP_NUM = 4; constexpr uint32_t MAX_ICON_SIZE = 50 * 1024; diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 01efae947275a84cdcee90103e995437ef3cf655..123747c6861de4b2c4e8f1ca91f0ad3e07d81304 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -1961,6 +1961,15 @@ ErrCode AdvancedNotificationService::FlowControl(const std::shared_ptr= MAX_ACTIVE_NUM_PERSECOND) { + std::stringstream stream; + auto timeT = std::chrono::system_clock::to_time_t(*flowControlTimestampList_.begin()); + stream << std::put_time(std::localtime(&timeT), "%H:%M:%S."); + auto msT = std::chrono::duration_cast( + (*flowControlTimestampList_.begin()).time_since_epoch()); + + stream << msT.count() % 1000; + + ANS_LOGD("id:%{public}d start time:%{public}s", record->request->GetNotificationId(), stream.str().c_str()); return ERR_ANS_OVER_MAX_ACITVE_PERSECOND; }