Commit bdd29cfb authored by Alex朱枝文's avatar Alex朱枝文

删除上报次数统计

parent 10f6e30a
...@@ -48,8 +48,6 @@ class YHButlerMessageReportHandler { ...@@ -48,8 +48,6 @@ class YHButlerMessageReportHandler {
}() }()
private var nightReported = false private var nightReported = false
private var dailyReportCount = 0
private let oneHourInterval: TimeInterval = 3600 private let oneHourInterval: TimeInterval = 3600
private let maxRetryCount = 3 private let maxRetryCount = 3
private let retryInterval: TimeInterval = 2.0 private let retryInterval: TimeInterval = 2.0
...@@ -73,11 +71,8 @@ class YHButlerMessageReportHandler { ...@@ -73,11 +71,8 @@ class YHButlerMessageReportHandler {
func reset() { func reset() {
messageQueue.async { [weak self] in messageQueue.async { [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.lastReportTime = getLastReportDate() self.lastReportTime = getLastReportDate()
self.nightReported = false self.nightReported = false
self.dailyReportCount = 0
printLog("###处理器状态已重置") printLog("###处理器状态已重置")
} }
} }
...@@ -149,7 +144,6 @@ class YHButlerMessageReportHandler { ...@@ -149,7 +144,6 @@ class YHButlerMessageReportHandler {
private func resetDailyStatus() { private func resetDailyStatus() {
nightReported = false nightReported = false
dailyReportCount = 0
} }
private func reportWithRetry(_ message: QYSessionInfo, _ userId: String, retryCount: Int) { private func reportWithRetry(_ message: QYSessionInfo, _ userId: String, retryCount: Int) {
...@@ -192,25 +186,15 @@ class YHButlerMessageReportHandler { ...@@ -192,25 +186,15 @@ class YHButlerMessageReportHandler {
UserDefaults.standard.synchronize() UserDefaults.standard.synchronize()
} }
self.dailyReportCount += 1
let hour = Calendar.current.component(.hour, from: Date()) let hour = Calendar.current.component(.hour, from: Date())
if hour >= 0 && hour < 8 { if hour >= 0 && hour < 8 {
self.nightReported = true self.nightReported = true
} }
// DispatchQueue.main.async {
// self.notifyReportCompletion(message, success: true)
// }
self.logReportSuccess(message) self.logReportSuccess(message)
} }
} }
private func handleReportFailure(_ message: QYSessionInfo) { private func handleReportFailure(_ message: QYSessionInfo) {
// DispatchQueue.main.async {
// self.notifyReportCompletion(message, success: false)
// }
printLog("###上报失败:") printLog("###上报失败:")
printLog("###消息ID: \(message.lastMessage?.messageId ?? "")") printLog("###消息ID: \(message.lastMessage?.messageId ?? "")")
printLog("###消息内容: \(message.lastMessageText ?? "")") printLog("###消息内容: \(message.lastMessageText ?? "")")
...@@ -252,7 +236,6 @@ class YHButlerMessageReportHandler { ...@@ -252,7 +236,6 @@ class YHButlerMessageReportHandler {
} }
printLog("###夜间已上报: \(nightReported)") printLog("###夜间已上报: \(nightReported)")
printLog("###今日上报次数: \(dailyReportCount)")
} }
private func logSkipReason() { private func logSkipReason() {
...@@ -281,6 +264,5 @@ class YHButlerMessageReportHandler { ...@@ -281,6 +264,5 @@ class YHButlerMessageReportHandler {
printLog("###消息内容: \(message.lastMessageText ?? "")") printLog("###消息内容: \(message.lastMessageText ?? "")")
let timeString = getTimeString(Date()) let timeString = getTimeString(Date())
printLog("###上报时间: \(timeString)") printLog("###上报时间: \(timeString)")
printLog("###今日上报次数: \(dailyReportCount)")
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment