qdone 2.0.39-alpha → 2.0.40-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,9 +25,7 @@ function getDeduplicationId(dedupContent, opt) {
25
25
  dedupContent = dedupContent.trim().replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/g, '_');
26
26
  const max = 128;
27
27
  const sep = '...sha1:';
28
- if (dedupContent.length > max) {
29
- dedupContent = dedupContent.slice(0, max - sep.length - 40) + '...sha1:' + (0, crypto_1.createHash)('sha1').update(dedupContent).digest('hex');
30
- }
28
+ dedupContent = dedupContent.slice(0, max - sep.length - 42) + '...sha1:{' + (0, crypto_1.createHash)('sha1').update(dedupContent).digest('hex') + '}';
31
29
  return dedupContent;
32
30
  }
33
31
  exports.getDeduplicationId = getDeduplicationId;
@@ -53,7 +53,7 @@ async function _cheapIdleCheck(qname, qrl, opt) {
53
53
  catch (e) {
54
54
  if (e instanceof client_sqs_1.QueueDoesNotExist) {
55
55
  // Count deleted queues as idle
56
- return { idle: true, SQS: 1 };
56
+ return { result: { idle: true }, SQS: 1 };
57
57
  }
58
58
  else {
59
59
  throw e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdone",
3
- "version": "2.0.39-alpha",
3
+ "version": "2.0.40-alpha",
4
4
  "description": "A distributed scheduler for SQS",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/src/dedup.js CHANGED
@@ -20,9 +20,7 @@ export function getDeduplicationId (dedupContent, opt) {
20
20
  dedupContent = dedupContent.trim().replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/g, '_')
21
21
  const max = 128
22
22
  const sep = '...sha1:'
23
- if (dedupContent.length > max) {
24
- dedupContent = dedupContent.slice(0, max - sep.length - 40) + '...sha1:' + createHash('sha1').update(dedupContent).digest('hex')
25
- }
23
+ dedupContent = dedupContent.slice(0, max - sep.length - 42) + '...sha1:{' + createHash('sha1').update(dedupContent).digest('hex') + '}'
26
24
  return dedupContent
27
25
  }
28
26
 
package/src/idleQueues.js CHANGED
@@ -50,7 +50,7 @@ export async function _cheapIdleCheck (qname, qrl, opt) {
50
50
  } catch (e) {
51
51
  if (e instanceof QueueDoesNotExist) {
52
52
  // Count deleted queues as idle
53
- return { idle: true, SQS: 1 }
53
+ return { result: { idle: true }, SQS: 1 }
54
54
  } else {
55
55
  throw e
56
56
  }