mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-01 02:31:36 -05:00
synchronized getNewMirrorOnError() for safe writing of numTries
`volatile` allows for safe multi-threaded reading, `synchronized` allows for safe multi-threaded writing.
This commit is contained in:
@@ -267,7 +267,7 @@ public class FDroidApp extends Application implements androidx.work.Configuratio
|
||||
* @see #getTimeout()
|
||||
* @see Repo#getRandomMirror(String)
|
||||
*/
|
||||
public static String getNewMirrorOnError(@Nullable String urlString, Repo repo2) throws IOException {
|
||||
public static synchronized String getNewMirrorOnError(@Nullable String urlString, Repo repo2) throws IOException {
|
||||
if (repo2.hasMirrors()) {
|
||||
if (numTries <= 0) {
|
||||
if (timeout == Downloader.DEFAULT_TIMEOUT) {
|
||||
|
||||
Reference in New Issue
Block a user