Purge database only once after a forced update
This commit is contained in:
parent
9ddd5bb1a7
commit
93efab2d12
@ -428,6 +428,9 @@ public class UpdateService extends JobIntentService {
|
|||||||
return;
|
return;
|
||||||
} else if ((manualUpdate || forcedUpdate) && fdroidPrefs.isOnDemandDownloadAllowed()) {
|
} else if ((manualUpdate || forcedUpdate) && fdroidPrefs.isOnDemandDownloadAllowed()) {
|
||||||
Utils.debugLog(TAG, "manually requested or forced update");
|
Utils.debugLog(TAG, "manually requested or forced update");
|
||||||
|
if (forcedUpdate) {
|
||||||
|
DBHelper.resetTransient(this);
|
||||||
|
}
|
||||||
} else if (!fdroidPrefs.isBackgroundDownloadAllowed() && !fdroidPrefs.isOnDemandDownloadAllowed()) {
|
} else if (!fdroidPrefs.isBackgroundDownloadAllowed() && !fdroidPrefs.isOnDemandDownloadAllowed()) {
|
||||||
Utils.debugLog(TAG, "don't run update");
|
Utils.debugLog(TAG, "don't run update");
|
||||||
return;
|
return;
|
||||||
@ -461,10 +464,6 @@ public class UpdateService extends JobIntentService {
|
|||||||
|
|
||||||
sendStatus(this, STATUS_INFO, getString(R.string.status_connecting_to_repo, repo.address));
|
sendStatus(this, STATUS_INFO, getString(R.string.status_connecting_to_repo, repo.address));
|
||||||
|
|
||||||
if (forcedUpdate) {
|
|
||||||
DBHelper.resetTransient(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RepoUpdater updater = new IndexV1Updater(this, repo);
|
RepoUpdater updater = new IndexV1Updater(this, repo);
|
||||||
if (Preferences.get().isForceOldIndexEnabled() || !updater.update()) {
|
if (Preferences.get().isForceOldIndexEnabled() || !updater.update()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user