Skip to content

Commit

Permalink
Merge pull request #206 from spoonconsulting/cdv-thread-pool
Browse files Browse the repository at this point in the history
Revert to using getThreadPool
  • Loading branch information
zfir authored Mar 28, 2022
2 parents 621965b + 9f01543 commit b453901
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/android/FileTransferBackground.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ private void sendError(final String id, final String reason, boolean userCancele

@Override
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) {
if(executorService == null) {
if (executorService == null) {
executorService = Executors.newScheduledThreadPool(4);
}

executorService.schedule(() -> {
cordova.getThreadPool().execute(() -> {
try {
switch (action) {
case "initManager":
Expand All @@ -151,7 +151,7 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
callbackContext.sendPluginResult(result);
exception.printStackTrace();
}
} , 0, TimeUnit.MILLISECONDS);
});

return true;
}
Expand Down

0 comments on commit b453901

Please sign in to comment.