Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tempFileWriteStream.on('close', resolve)
tempFileWriteStream.on('error', reject)
})
// Load a `Database` from the file to check that it's valid.
await new JsonDatabase().load(tempFile.path, () => noopTransformer)
// Replace the old LSIF file with the new file.
try {
await fs.mkdir(STORAGE_ROOT)
} catch (e) {
if (e.code !== 'EEXIST') {
throw e
}
}
await moveFile(tempFile.path, diskKey({ repository, commit }))
// Evict the old `Database` from the LRU cache to cause it to pick up the new LSIF data from disk.
dbLRU.del(diskKey({ repository, commit }))
res.send('Upload successful.')
})