v0.3.1: HotDealPollingWorker.kt
This commit is contained in:
@@ -116,11 +116,18 @@ class HotDealPollingWorker @AssistedInject constructor(
|
||||
// 8. 알림 발송 상태 업데이트
|
||||
dealDao.markAsNotified(newDeals.map { it.id })
|
||||
|
||||
// 9. 오래된 데이터 정리 (3일 이상 - 배터리/데이터 절약)
|
||||
// 9. 인기글 상태 업데이트 (신규+기존 딜 모두 HOT 마킹)
|
||||
val popularDealIds = allDeals.filter { it.isPopular }.map { it.id }
|
||||
if (popularDealIds.isNotEmpty()) {
|
||||
dealDao.markAsPopular(popularDealIds)
|
||||
Log.d(TAG, "인기글 마킹: ${popularDealIds.size}개")
|
||||
}
|
||||
|
||||
// 10. 오래된 데이터 정리 (3일 이상 - 배터리/데이터 절약)
|
||||
val threshold = System.currentTimeMillis() - (3 * 24 * 60 * 60 * 1000L)
|
||||
dealDao.deleteOldDeals(threshold)
|
||||
|
||||
Log.d(TAG, "===== 핫딜 폴� 완료 =====")
|
||||
Log.d(TAG, "===== 핫딜 폴 완료 =====")
|
||||
Result.success()
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "폴� 오류: ${e.message}", e)
|
||||
|
||||
Reference in New Issue
Block a user