File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const cd_file = {
19
19
const crawlerStoreProvider = config . get ( 'CRAWLER_STORE_PROVIDER' ) || 'cd(file)'
20
20
const maxRequeueAttemptCount = config . get ( 'CRAWLER_MAX_REQUEUE_ATTEMPTS' ) || 5
21
21
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' ) )
22
23
23
24
module . exports = {
24
25
provider : 'memory' , // change this to redis if/when we want distributed config
@@ -117,7 +118,8 @@ module.exports = {
117
118
account : cd_azblob . account ,
118
119
queueName : config . get ( 'CRAWLER_HARVESTS_QUEUE_NAME' ) || 'harvests' ,
119
120
spnAuth : config . get ( 'CRAWLER_HARVESTS_QUEUE_SPN_AUTH' ) ,
120
- isSpnAuth : config . get ( 'CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH' ) || false
121
+ isSpnAuth : config . get ( 'CRAWLER_HARVESTS_QUEUE_IS_SPN_AUTH' ) || false ,
122
+ visibilityTimeout : isNaN ( azqueueVisibilityTimeoutSeconds ) ? 5 * 60 : azqueueVisibilityTimeoutSeconds // 5 minutes default
121
123
} ,
122
124
'cd(azblob)' : cd_azblob ,
123
125
'cd(file)' : cd_file
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ class AzureStorageQueue {
54
54
55
55
async upsert ( document ) {
56
56
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 )
58
59
}
59
60
60
61
get ( ) {
You can’t perform that action at this time.
0 commit comments