caravaggio
Advanced tools
Comparing version 2.3.4 to 2.3.5
# Changelog | ||
## 2.3.5 | ||
- Caches are faster. Now the policy is to return the cached value before saving if possible | ||
- Fixed a bug which prevent running verbose mode in production | ||
## 2.3.4 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "caravaggio", | ||
"version": "2.3.4", | ||
"version": "2.3.5", | ||
"description": "A blazing fast image processor service", | ||
@@ -38,7 +38,8 @@ "main": "index.js", | ||
"md5": "^2.2.1", | ||
"micro": "^9.3.0", | ||
"micro": "^9.3.3", | ||
"micro-redirect": "^1.0.0", | ||
"microrouter": "^3.1.2", | ||
"node-fetch": "^2.1.2", | ||
"pino": "^5.4.0", | ||
"pino": "^5.5.0", | ||
"pino-pretty": "^2.2.0", | ||
"sharp": "^0.20.8", | ||
@@ -48,10 +49,9 @@ "yargs": "12.0.2" | ||
"devDependencies": { | ||
"eslint": "^5.4.0", | ||
"eslint": "^5.6.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-import-resolver-jest": "^2.1.1", | ||
"eslint-plugin-import": "^2.11.0", | ||
"eslint-plugin-jest": "^21.15.1", | ||
"jest": "^23.5.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-jest": "^21.22.0", | ||
"jest": "^23.6.0", | ||
"micro-dev": "3.0.0", | ||
"pino-pretty": "^2.0.1", | ||
"request-promise": "^4.2.2", | ||
@@ -58,0 +58,0 @@ "test-listen": "^1.1.0" |
const fs = require('fs-extra'); | ||
const os = require('os'); | ||
const path = require('path'); | ||
const logger = require('../logger'); | ||
@@ -32,10 +33,15 @@ const DEFAULT_TEMP_DIR = os.tmpdir(); | ||
save: (filename, buffer) => fs | ||
.outputFile(getCompleteFilename(filename), buffer, { encoding: null }) | ||
.then(() => ({ | ||
save: async (filename, buffer) => { | ||
const completeFilename = getCompleteFilename(filename); | ||
fs.outputFile(completeFilename, buffer, { encoding: null }) | ||
.catch((e) => { | ||
logger.error(e, `File persistor failed to save file ${completeFilename}`); | ||
}); | ||
return { | ||
type: 'buffer', | ||
buffer, | ||
})), | ||
}; | ||
}, | ||
}; | ||
}; |
@@ -26,11 +26,10 @@ | ||
module.exports = ({ limit } = { limit: 100 }) => ({ | ||
flush: () => { | ||
flush: async () => { | ||
persisted.files = {}; | ||
persisted.size = 0; | ||
return Promise.resolve(); | ||
}, | ||
exists: filename => Promise.resolve(!!persisted.files[filename]), | ||
exists: async filename => !!persisted.files[filename], | ||
read: filename => Promise.resolve(persisted.files[filename] | ||
read: async filename => (persisted.files[filename] | ||
? { | ||
@@ -42,12 +41,11 @@ type: 'buffer', | ||
save: (filename, buffer) => { | ||
save: async (filename, buffer) => { | ||
persisted.files[filename] = buffer; | ||
increaseSize(buffer.length); | ||
checkMemory(limit, filename); | ||
return Promise.resolve({ | ||
return { | ||
type: 'buffer', | ||
buffer, | ||
}); | ||
}; | ||
}, | ||
}); |
module.exports = () => ({ | ||
exists: Promise.resolve(false), | ||
exists: async () => false, | ||
read: () => Promise.resolve(null), | ||
read: async () => null, | ||
save: (filename, buffer) => Promise.resolve({ | ||
save: async (filename, buffer) => ({ | ||
type: 'buffer', | ||
@@ -8,0 +8,0 @@ buffer, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62089
9
1483
11
+ Addedpino-pretty@^2.2.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedargs@5.0.3(transitive)
+ Addedcamelcase@5.0.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addeddateformat@3.0.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfast-json-parse@1.0.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedjmespath@0.15.0(transitive)
+ Addedleven@2.1.0(transitive)
+ Addedmri@1.1.4(transitive)
+ Addedpino-pretty@2.6.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsplit2@3.2.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
Updatedmicro@^9.3.3
Updatedpino@^5.5.0