File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/core/src/v3/resource-catalog Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,29 @@ export class StandardResourceCatalog implements ResourceCatalog {
24
24
}
25
25
26
26
registerQueueMetadata ( queue : QueueManifest ) : void {
27
+ const existingQueue = this . _queueMetadata . get ( queue . name ) ;
28
+
29
+ //if it exists already AND concurrencyLimit or releaseConcurrencyOnWaitpoint is different, log a warning
30
+ if ( existingQueue ) {
31
+ const isConcurrencyLimitDifferent = existingQueue . concurrencyLimit !== queue . concurrencyLimit ;
32
+ const isReleaseConcurrencyOnWaitpointDifferent =
33
+ existingQueue . releaseConcurrencyOnWaitpoint !== queue . releaseConcurrencyOnWaitpoint ;
34
+
35
+ if ( isConcurrencyLimitDifferent || isReleaseConcurrencyOnWaitpointDifferent ) {
36
+ let message = `Queue "${ queue . name } " is defined twice, with different settings.` ;
37
+ if ( isConcurrencyLimitDifferent ) {
38
+ message += `\n - concurrencyLimit: ${ existingQueue . concurrencyLimit } vs ${ queue . concurrencyLimit } ` ;
39
+ }
40
+ if ( isReleaseConcurrencyOnWaitpointDifferent ) {
41
+ message += `\n - releaseConcurrencyOnWaitpoint: ${ existingQueue . releaseConcurrencyOnWaitpoint } vs ${ queue . releaseConcurrencyOnWaitpoint } ` ;
42
+ }
43
+
44
+ message += "\n Skipping the second definition." ;
45
+ console . warn ( message ) ;
46
+ return ;
47
+ }
48
+ }
49
+
27
50
this . _queueMetadata . set ( queue . name , queue ) ;
28
51
}
29
52
You can’t perform that action at this time.
0 commit comments