diff --git a/src/storage/gcs.js b/src/storage/gcs.js index 1bf915e93..19055873e 100644 --- a/src/storage/gcs.js +++ b/src/storage/gcs.js @@ -256,7 +256,7 @@ async function verifyConfig({ id, provider, config }) { const uploadStream = testFile.createWriteStream({ resumable: false }); await new Promise((resolve, reject) => { - uploadStream.on('error', function(error) { + uploadStream.on('error', (error) => { debug('testConfig: failed uploading cloudron-testfile. %o', error); if (error && error.code && (error.code == 403 || error.code == 404)) { return reject(new BoxError(BoxError.BAD_FIELD, error.message)); @@ -264,10 +264,8 @@ async function verifyConfig({ id, provider, config }) { return reject(new BoxError(BoxError.EXTERNAL_ERROR, error.message)); }); - uploadStream.write('testfilecontents'); - uploadStream.end(); - uploadStream.on('finish', resolve); + uploadStream.end('testfilecontents'); }); debug('testConfig: uploaded cloudron-testfile');