* @internal * * The stream is considered constructed when the indexes are done being created
(callback: (error?: Error | null) => void)
| 147 | * The stream is considered constructed when the indexes are done being created |
| 148 | */ |
| 149 | override _construct(callback: (error?: Error | null) => void): void { |
| 150 | if (!this.bucket.s.calledOpenUploadStream) { |
| 151 | this.bucket.s.calledOpenUploadStream = true; |
| 152 | |
| 153 | checkIndexes(this).then( |
| 154 | () => { |
| 155 | this.bucket.s.checkedIndexes = true; |
| 156 | this.bucket.emit('index'); |
| 157 | callback(); |
| 158 | }, |
| 159 | error => { |
| 160 | if (error instanceof MongoOperationTimeoutError) { |
| 161 | return handleError(this, error, callback); |
| 162 | } |
| 163 | squashError(error); |
| 164 | callback(); |
| 165 | } |
| 166 | ); |
| 167 | } else { |
| 168 | return queueMicrotask(callback); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * @internal |
nothing calls this directly
no test coverage detected