Prevent crash for servers that don't send etags with repo indexes
Always capture timestamps, even if it is the same. This is because we are dependent on it later on in the repo update process. Specifically, when updating from a HTTP server that doesn't send out etags with its responses, it will trigger a full blown repo update every time, even if all the values in the index are the same (name, description, etc). This is as distinct from better behaving servers that send etags, in which case we will only do a partial update (i.e. persist the "last updated time"). In such a case, the remainder of the update process will proceed, and ask for this timestamp.
This commit is contained in:
parent
ae6fd96256
commit
b9b3908dc3
@ -278,9 +278,13 @@ public class RepoUpdater {
|
|||||||
values.put(RepoTable.Cols.NAME, name);
|
values.put(RepoTable.Cols.NAME, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestamp != repo.timestamp) {
|
// Always put a timestamp here, even if it is the same. This is because we are dependent
|
||||||
values.put(RepoTable.Cols.TIMESTAMP, timestamp);
|
// on it later on in the process. Specifically, when updating from a HTTP server that
|
||||||
}
|
// doesn't send out etags with its responses, it will trigger a full blown repo update
|
||||||
|
// every time, even if all the values in the index are the same (name, description, etc).
|
||||||
|
// In such a case, the remainder of the update process will proceed, and ask for this
|
||||||
|
// timestamp.
|
||||||
|
values.put(RepoTable.Cols.TIMESTAMP, timestamp);
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user