Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f903a1c8
Commit
f903a1c8
authored
Feb 14, 2017
by
Todd Volkert
Committed by
GitHub
Feb 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add retry writing to DevFS. (#8142)
This is a workaround to #8141
parent
43650e93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+14
-4
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
f903a1c8
...
...
@@ -222,6 +222,7 @@ class _DevFSHttpWriter {
final
Uri
httpAddress
;
static
const
int
kMaxInFlight
=
6
;
static
const
int
kMaxRetries
=
3
;
int
_inFlight
=
0
;
Map
<
String
,
DevFSContent
>
_outstanding
;
...
...
@@ -256,9 +257,12 @@ class _DevFSHttpWriter {
}
}
Future
<
Null
>
_scheduleWrite
(
String
devicePath
,
DevFSContent
content
,
DevFSProgressReporter
progressReporter
)
async
{
Future
<
Null
>
_scheduleWrite
(
String
devicePath
,
DevFSContent
content
,
DevFSProgressReporter
progressReporter
,
[
int
retry
=
0
,
])
async
{
try
{
HttpClientRequest
request
=
await
_client
.
putUrl
(
httpAddress
);
request
.
headers
.
removeAll
(
HttpHeaders
.
ACCEPT_ENCODING
);
...
...
@@ -270,7 +274,13 @@ class _DevFSHttpWriter {
HttpClientResponse
response
=
await
request
.
close
();
await
response
.
drain
<
Null
>();
}
catch
(
e
)
{
printError
(
'Error writing "
$devicePath
" to DevFS:
$e
'
);
if
(
retry
<
kMaxRetries
)
{
printTrace
(
'Retrying writing "
$devicePath
" to DevFS due to error:
$e
'
);
_scheduleWrite
(
devicePath
,
content
,
progressReporter
,
retry
+
1
);
return
;
}
else
{
printError
(
'Error writing "
$devicePath
" to DevFS:
$e
'
);
}
}
if
(
progressReporter
!=
null
)
{
_done
++;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment