File tree 1 file changed +3
-2
lines changed
app/src/main/java/fr/free/nrw/commons/category
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 47
47
import java .util .concurrent .CountDownLatch ;
48
48
import java .util .concurrent .ExecutionException ;
49
49
import java .util .concurrent .ScheduledThreadPoolExecutor ;
50
+ import java .util .concurrent .TimeUnit ;
50
51
51
52
import fr .free .nrw .commons .CommonsApplication ;
52
53
import fr .free .nrw .commons .R ;
@@ -151,7 +152,7 @@ protected void onPostExecute(ArrayList<String> result) {
151
152
152
153
//Only return titleCatItems after API call has finished
153
154
try {
154
- mergeLatch .await ();
155
+ mergeLatch .await (5L , TimeUnit . SECONDS );
155
156
} catch (InterruptedException e ) {
156
157
Log .e (TAG , "Interrupted exception: " , e );
157
158
}
@@ -204,7 +205,7 @@ protected ArrayList<String> mergeItems() {
204
205
205
206
//Await results of titleItems, which is likely to come in last
206
207
try {
207
- mergeLatch .await ();
208
+ mergeLatch .await (5L , TimeUnit . SECONDS );
208
209
Log .d (TAG , "Waited for merge" );
209
210
} catch (InterruptedException e ) {
210
211
Log .e (TAG , "Interrupted Exception: " , e );
You can’t perform that action at this time.
0 commit comments