Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azurite

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azurite - npm Package Compare versions

Comparing version 0.6.12 to 0.6.13

72

lib/StorageManager.js

@@ -356,12 +356,2 @@ 'use strict';

// Writing multiple blocks to one blob
const combinedStream = CombinedStream.create();
for (const blockName of blockPaths) {
combinedStream.append(fs.createReadStream(blockName));
}
const blobPath = path.join(env.localStoragePath, containerName, blob.name);
// FIXME: The entire REST call may return before the file has been entirely written to disk!
combinedStream.pipe(fs.createWriteStream(blobPath));
// Updating properties of blob

@@ -391,21 +381,46 @@ const coll = this.db.getCollection(containerName);

}
// Set Blocks in DB to committed = true, delete blocks not in BlockList
const promises = [];
const collCommits = this.db.getCollection(StorageTables.Commits);
const blocks = collCommits.chain()
.find({ parent: `${containerName}-${blob.name}` })
.data();
for (const block of blocks) {
if (blockList.map((e) => { return e.id }).indexOf(block.blockId) !== -1) {
block.committed = true;
collCommits.update(block);
} else {
collCommits.remove(block);
promises.push(fs.removeAsync(path.join(env.commitsPath, block.name)));
}
// Writing multiple blocks to one blob
const combinedStream = CombinedStream.create();
for (const blockName of blockPaths) {
combinedStream.append(fs.createReadStream(blockName));
}
return BbPromise.all(promises)
.then(() => {
return response;
});
const blobPath = path.join(env.localStoragePath, containerName, blob.name);
return new BbPromise((resolve, reject) => {
const destinationStream = fs.createWriteStream(blobPath);
destinationStream
.on('error', (e) => {
reject(e);
})
.on('finish', () => {
let totalSize = 0;
// Set Blocks in DB to committed = true, delete blocks not in BlockList
const promises = [];
const collCommits = this.db.getCollection(StorageTables.Commits);
const blocks = collCommits.chain()
.find({ parent: `${containerName}-${blob.name}` })
.data();
for (const block of blocks) {
if (blockList.map((e) => { return e.id }).indexOf(block.blockId) !== -1) {
block.committed = true;
totalSize += block.size;
collCommits.update(block);
} else {
collCommits.remove(block);
promises.push(fs.removeAsync(path.join(env.commitsPath, block.name)));
}
}
return BbPromise.all(promises)
.then(() => {
const updateBlob = coll.chain()
.find({ 'name': { '$eq': blob.name } })
.data()[0];
updateBlob.size = totalSize;
coll.update(updateBlob);
resolve(response);
});
});
combinedStream.pipe(destinationStream);
});
});

@@ -642,3 +657,2 @@ }

updatedBlob.size = fs.statSync(blobPath).size;
updatedBlob.httpProps['Content-Length'] = updatedBlob.size;
updatedBlob.httpProps['x-ms-blob-sequence-number'] = updatedBlob.meta.revision;

@@ -645,0 +659,0 @@ coll.update(updatedBlob);

{
"name": "azurite",
"version": "0.6.12",
"version": "0.6.13",
"description": "A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc