From 8df4c97a74faf8aacb03df75d83909c1f5099f34 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 28 Aug 2019 11:07:49 -0700 Subject: [PATCH] [AltStore] Limits background app refreshing to once every 6 hours --- AltStore/Model/InstalledApp.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AltStore/Model/InstalledApp.swift b/AltStore/Model/InstalledApp.swift index 6c5f2003..e552ed6f 100644 --- a/AltStore/Model/InstalledApp.swift +++ b/AltStore/Model/InstalledApp.swift @@ -99,7 +99,8 @@ extension InstalledApp class func fetchAppsForBackgroundRefresh(in context: NSManagedObjectContext) -> [InstalledApp] { - let date = Date().addingTimeInterval(-120) + // Date 6 hours before now. + let date = Date().addingTimeInterval(-1 * 6 * 60 * 60) let predicate = NSPredicate(format: "(%K < %@) AND (%K != %@)", #keyPath(InstalledApp.refreshedDate), date as NSDate,