mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Create a separate api object for modifications sync
This prevents the same HTTPClient being re-used across different threads, causing problems Long-term fix needed, however
This commit is contained in:
parent
1816f792f8
commit
8a7966687a
1 changed files with 2 additions and 3 deletions
|
|
@ -44,10 +44,9 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||
return;
|
||||
}
|
||||
|
||||
CommonsApplication app = (CommonsApplication)getContext().getApplicationContext();
|
||||
String authCookie;
|
||||
try {
|
||||
authCookie = AccountManager.get(app).blockingGetAuthToken(account, "", false);
|
||||
authCookie = AccountManager.get(getContext()).blockingGetAuthToken(account, "", false);
|
||||
} catch (OperationCanceledException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IOException e) {
|
||||
|
|
@ -56,7 +55,7 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
MWApi api = app.getApi();
|
||||
MWApi api = CommonsApplication.createMWApi();
|
||||
api.setAuthCookie(authCookie);
|
||||
String editToken;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue