Merge pull request #382 from josephroque/timeout-android
Respect readTimeout and connectionTimeout for downloadFile on Android
This commit is contained in:
commit
b353e2bfe9
|
@ -556,6 +556,8 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
||||||
final int jobId = options.getInt("jobId");
|
final int jobId = options.getInt("jobId");
|
||||||
ReadableMap headers = options.getMap("headers");
|
ReadableMap headers = options.getMap("headers");
|
||||||
int progressDivider = options.getInt("progressDivider");
|
int progressDivider = options.getInt("progressDivider");
|
||||||
|
int readTimeout = options.getInt("readTimeout");
|
||||||
|
int connectionTimeout = options.getInt("connectionTimeout");
|
||||||
|
|
||||||
DownloadParams params = new DownloadParams();
|
DownloadParams params = new DownloadParams();
|
||||||
|
|
||||||
|
@ -563,6 +565,8 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
||||||
params.dest = file;
|
params.dest = file;
|
||||||
params.headers = headers;
|
params.headers = headers;
|
||||||
params.progressDivider = progressDivider;
|
params.progressDivider = progressDivider;
|
||||||
|
params.readTimeout = readTimeout;
|
||||||
|
params.connectionTimeout = connectionTimeout;
|
||||||
|
|
||||||
params.onTaskCompleted = new DownloadParams.OnTaskCompleted() {
|
params.onTaskCompleted = new DownloadParams.OnTaskCompleted() {
|
||||||
public void onTaskCompleted(DownloadResult res) {
|
public void onTaskCompleted(DownloadResult res) {
|
||||||
|
|
Loading…
Reference in New Issue