Skip to content

Commit c26d67a

Browse files
authored
Merge branch 'master' into jkbschmid-licensee-parallel
2 parents 41f0f29 + a75dbd5 commit c26d67a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

config/cdConfig.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const cd_file = {
1919
const crawlerStoreProvider = config.get('CRAWLER_STORE_PROVIDER') || 'cd(file)'
2020
const maxRequeueAttemptCount = config.get('CRAWLER_MAX_REQUEUE_ATTEMPTS') || 5
2121
const fetchedCacheTtlSeconds = config.get('CRAWLER_FETCHED_CACHE_TTL_SECONDS') || 60 * 60 * 8 //8 hours
22+
const azqueueVisibilityTimeoutSeconds = parseInt(config.get('CRAWLER_HARVESTS_QUEUE_VISIBILITY_TIMEOUT_SECONDS'))
2223

2324
function getPositiveNum(configName, defaultValue) {
2425
const num = Number(config.get(configName))
@@ -124,7 +125,8 @@ module.exports = {
124125
account: cd_azblob.account,
125126
queueName: config.get('CRAWLER_HARVESTS_QUEUE_NAME') || 'harvests',
126127
spnAuth: config.get('CRAWLER_HARVESTS_QUEUE_SPN_AUTH'),
127-
isSpnAuth: config.get('CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH') || false
128+
isSpnAuth: config.get('CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH') || false,
129+
visibilityTimeout: isNaN(azqueueVisibilityTimeoutSeconds) ? 5 * 60 : azqueueVisibilityTimeoutSeconds // 5 minutes default
128130
},
129131
'cd(azblob)': cd_azblob,
130132
'cd(file)': cd_file

providers/store/azureQueueStore.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class AzureStorageQueue {
5454

5555
async upsert(document) {
5656
const message = Buffer.from(JSON.stringify({ _metadata: document._metadata })).toString('base64')
57-
return await this.queueService.sendMessage(message)
57+
const options = { visibilityTimeout: this.options.visibilityTimeout || 0 }
58+
return await this.queueService.sendMessage(message, options)
5859
}
5960

6061
get() {

0 commit comments

Comments
 (0)