We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e98838a commit bdc85b4Copy full SHA for bdc85b4
1 file changed
app/src/main/java/org/schabi/newpipe/CheckForNewAppVersion.java
@@ -179,6 +179,8 @@ public static Disposable checkNewVersion(@NonNull final App app) {
179
return null;
180
}
181
182
+ // Check if the last request has happened a certain time ago
183
+ // to reduce the number of API requests.
184
final long expiry = prefs.getLong(app.getString(R.string.update_expiry_key), 0);
185
if (!manager.isExpired(expiry)) {
186
@@ -198,6 +200,8 @@ public static Disposable checkNewVersion(@NonNull final App app) {
198
200
.subscribe(
199
201
response -> {
202
try {
203
+ // Store a timestamp which needs to be exceeded,
204
+ // before a new request to the API is made.
205
final long newExpiry = manager
206
.coerceExpiry(response.getHeader("expires"));
207
prefs.edit()
0 commit comments