Skip to content

Commit 43cbcde

Browse files
committed
Add support for visibility timeout in AzureQueueStore
Implement visibility timeout functionality in AzureQueueStore to allow messages to be hidden for a specified duration after being pushed onto the queue. This enhancement works in conjunction with the improvements in definition computation on the service side, reducing the number of definition computations when component harvest results are available.
1 parent 489728c commit 43cbcde

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

config/cdConfig.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ module.exports = {
117117
account: cd_azblob.account,
118118
queueName: config.get('CRAWLER_HARVESTS_QUEUE_NAME') || 'harvests',
119119
spnAuth: config.get('CRAWLER_HARVESTS_QUEUE_SPN_AUTH'),
120-
isSpnAuth: config.get('CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH') || false
120+
isSpnAuth: config.get('CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH') || false,
121+
visibilityTimeout: parseInt(config.get('CRAWLER_HARVESTS_QUEUE_VISIBILITY_TIMEOUT_SECONDS')) || 0
121122
},
122123
'cd(azblob)': cd_azblob,
123124
'cd(file)': cd_file

providers/store/azureQueueStore.js

+2-1
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)