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
ef5fc1ae
Unverified
Commit
ef5fc1ae
authored
Jun 07, 2019
by
Jonah Williams
Committed by
GitHub
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
limit open files on macOS when copying assets (#34050)
parent
bc3ca10e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
bundle.dart
packages/flutter_tools/lib/src/bundle.dart
+11
-3
No files found.
packages/flutter_tools/lib/src/bundle.dart
View file @
ef5fc1ae
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:async'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
import
'package:pool/pool.dart'
;
import
'artifacts.dart'
;
import
'artifacts.dart'
;
import
'asset.dart'
;
import
'asset.dart'
;
...
@@ -226,10 +227,17 @@ Future<void> writeBundle(
...
@@ -226,10 +227,17 @@ Future<void> writeBundle(
bundleDir
.
deleteSync
(
recursive:
true
);
bundleDir
.
deleteSync
(
recursive:
true
);
bundleDir
.
createSync
(
recursive:
true
);
bundleDir
.
createSync
(
recursive:
true
);
// Limit number of open files to avoid running out of file descriptors.
final
Pool
pool
=
Pool
(
64
);
await
Future
.
wait
<
void
>(
await
Future
.
wait
<
void
>(
assetEntries
.
entries
.
map
<
Future
<
void
>>((
MapEntry
<
String
,
DevFSContent
>
entry
)
async
{
assetEntries
.
entries
.
map
<
Future
<
void
>>((
MapEntry
<
String
,
DevFSContent
>
entry
)
async
{
final
File
file
=
fs
.
file
(
fs
.
path
.
join
(
bundleDir
.
path
,
entry
.
key
));
final
PoolResource
resource
=
await
pool
.
request
();
file
.
parent
.
createSync
(
recursive:
true
);
try
{
await
file
.
writeAsBytes
(
await
entry
.
value
.
contentsAsBytes
());
final
File
file
=
fs
.
file
(
fs
.
path
.
join
(
bundleDir
.
path
,
entry
.
key
));
file
.
parent
.
createSync
(
recursive:
true
);
await
file
.
writeAsBytes
(
await
entry
.
value
.
contentsAsBytes
());
}
finally
{
resource
.
release
();
}
}));
}));
}
}
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