(maxSpanWaitDuration: number | undefined)
| 113 | |
| 114 | /** Just exported for tests. */ |
| 115 | export function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined { |
| 116 | if (maxSpanWaitDuration == null) { |
| 117 | return undefined; |
| 118 | } |
| 119 | |
| 120 | // We guard for a max. value here, because we create an array with this length |
| 121 | // So if this value is too large, this would fail |
| 122 | if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) { |
| 123 | DEBUG_BUILD && |
| 124 | coreDebug.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`); |
| 125 | return MAX_MAX_SPAN_WAIT_DURATION; |
| 126 | } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) { |
| 127 | DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.'); |
| 128 | return undefined; |
| 129 | } |
| 130 | |
| 131 | return maxSpanWaitDuration; |
| 132 | } |
no test coverage detected