Skip to content

Commit c1ce468

Browse files
committed
fix: always close gridfs upload stream on finish
1 parent a516903 commit c1ce468

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.evergreen/config.yml

+32
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,12 @@ buildvariants:
12251225
expansions:
12261226
NODE_LTS_NAME: erbium
12271227
tasks: *ref_0
1228+
- name: macos-1014-fermium
1229+
display_name: macOS 10.14 Node Fermium
1230+
run_on: macos-1014
1231+
expansions:
1232+
NODE_LTS_NAME: fermium
1233+
tasks: *ref_0
12281234
- name: rhel70-dubnium
12291235
display_name: RHEL 7.0 Node Dubnium
12301236
run_on: rhel70-small
@@ -1291,6 +1297,12 @@ buildvariants:
12911297
expansions:
12921298
NODE_LTS_NAME: erbium
12931299
tasks: *ref_1
1300+
- name: rhel70-fermium
1301+
display_name: RHEL 7.0 Node Fermium
1302+
run_on: rhel70-small
1303+
expansions:
1304+
NODE_LTS_NAME: fermium
1305+
tasks: *ref_1
12941306
- name: ubuntu-14.04-dubnium
12951307
display_name: Ubuntu 14.04 Node Dubnium
12961308
run_on: ubuntu1404-large
@@ -1325,6 +1337,12 @@ buildvariants:
13251337
expansions:
13261338
NODE_LTS_NAME: erbium
13271339
tasks: *ref_2
1340+
- name: ubuntu-14.04-fermium
1341+
display_name: Ubuntu 14.04 Node Fermium
1342+
run_on: ubuntu1404-large
1343+
expansions:
1344+
NODE_LTS_NAME: fermium
1345+
tasks: *ref_2
13281346
- name: ubuntu-18.04-dubnium
13291347
display_name: Ubuntu 18.04 Node Dubnium
13301348
run_on: ubuntu1804-large
@@ -1387,6 +1405,13 @@ buildvariants:
13871405
NODE_LTS_NAME: erbium
13881406
CLIENT_ENCRYPTION: true
13891407
tasks: *ref_3
1408+
- name: ubuntu-18.04-fermium
1409+
display_name: Ubuntu 18.04 Node Fermium
1410+
run_on: ubuntu1804-large
1411+
expansions:
1412+
NODE_LTS_NAME: fermium
1413+
CLIENT_ENCRYPTION: true
1414+
tasks: *ref_3
13901415
- name: windows-64-vs2015-dubnium
13911416
display_name: Windows (VS2015) Node Dubnium
13921417
run_on: windows-64-vs2015-large
@@ -1424,6 +1449,13 @@ buildvariants:
14241449
NODE_LTS_NAME: erbium
14251450
MSVS_VERSION: 2015
14261451
tasks: *ref_4
1452+
- name: windows-64-vs2015-fermium
1453+
display_name: Windows (VS2015) Node Fermium
1454+
run_on: windows-64-vs2015-large
1455+
expansions:
1456+
NODE_LTS_NAME: fermium
1457+
MSVS_VERSION: 2015
1458+
tasks: *ref_4
14271459
- name: windows-64-vs2017-dubnium
14281460
display_name: Windows (VS2017) Node Dubnium
14291461
run_on: windows-64-vs2017-large

src/gridfs-stream/upload.ts

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export class GridFSBucketWriteStream extends Writable {
6767
};
6868
writeConcern?: WriteConcern;
6969

70+
/** @event */
71+
static readonly CLOSE = 'close';
7072
/** @event */
7173
static readonly ERROR = 'error';
7274
/**
@@ -325,6 +327,7 @@ function checkDone(stream: GridFSBucketWriteStream, callback?: Callback): boolea
325327
return __handleError(stream, error, callback);
326328
}
327329
stream.emit(GridFSBucketWriteStream.FINISH, filesDoc);
330+
stream.emit(GridFSBucketWriteStream.CLOSE);
328331
});
329332

330333
return true;

0 commit comments

Comments
 (0)