mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
Change event to close
This commit is contained in:
parent
71b62cb3aa
commit
49664be9e1
|
@ -44,7 +44,7 @@ export default class FileCacheProvider {
|
||||||
/**
|
/**
|
||||||
* Returns a write stream for the given hash key.
|
* Returns a write stream for the given hash key.
|
||||||
* The stream handles saving a new file and will
|
* The stream handles saving a new file and will
|
||||||
* update the database after the stream is finished.
|
* update the database after the stream is closed.
|
||||||
* @param hash lookup key
|
* @param hash lookup key
|
||||||
*/
|
*/
|
||||||
createWriteStream(hash: string) {
|
createWriteStream(hash: string) {
|
||||||
|
@ -53,7 +53,7 @@ export default class FileCacheProvider {
|
||||||
|
|
||||||
const stream = createWriteStream(tmpPath);
|
const stream = createWriteStream(tmpPath);
|
||||||
|
|
||||||
stream.on('finish', async () => {
|
stream.on('close', async () => {
|
||||||
// Only move if size is non-zero (may have errored out)
|
// Only move if size is non-zero (may have errored out)
|
||||||
const stats = await fs.stat(tmpPath);
|
const stats = await fs.stat(tmpPath);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue