aws-sdk-wrap
Advanced tools
Comparing version 12.6.1 to 12.6.2
@@ -7,15 +7,24 @@ import crypto from 'crypto'; | ||
} = {}) => { | ||
const model = Model({ | ||
name: lockTable, | ||
attributes: { | ||
id: { type: 'string', partitionKey: true }, | ||
guid: { type: 'string' }, | ||
leaseDurationMs: { type: 'number' }, | ||
lockAcquiredTimeUnixMs: { type: 'number' }, | ||
owner: { type: 'string' } | ||
let mdl; | ||
const getModelCached = () => { | ||
if (mdl === undefined) { | ||
mdl = Model({ | ||
name: lockTable, | ||
attributes: { | ||
id: { type: 'string', partitionKey: true }, | ||
guid: { type: 'string' }, | ||
leaseDurationMs: { type: 'number' }, | ||
lockAcquiredTimeUnixMs: { type: 'number' }, | ||
owner: { type: 'string' } | ||
} | ||
}); | ||
} | ||
}); | ||
return mdl; | ||
}; | ||
return { | ||
_model: model, | ||
get _model() { | ||
return getModelCached(); | ||
}, | ||
lock: async (lockName) => { | ||
const model = getModelCached(); | ||
const nowInMs = new Date() / 1; | ||
@@ -22,0 +31,0 @@ const lockResult = await model.createOrReplace({ |
{ | ||
"name": "aws-sdk-wrap", | ||
"type": "module", | ||
"version": "12.6.1", | ||
"version": "12.6.2", | ||
"description": "Wrapper around aws-sdk", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
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
85859
2033