@@ -28,7 +28,6 @@ type LambdaExtensionConfig struct {
28
28
LogLevel logrus.Level
29
29
MaxDataQueueLength int
30
30
MaxConcurrentRequests int
31
- ProcessingSleepTime time.Duration
32
31
MaxRetryAttempts int
33
32
RetrySleepTime time.Duration
34
33
ConnectionTimeoutValue time.Duration
@@ -37,7 +36,8 @@ type LambdaExtensionConfig struct {
37
36
SourceCategoryOverride string
38
37
}
39
38
40
- var validLogTypes = []string {"platform" , "function" }
39
+ var defaultLogTypes = []string {"platform" , "function" }
40
+ var validLogTypes = []string {"platform" , "function" , "extension" }
41
41
42
42
// GetConfig to get config instance
43
43
func GetConfig () (* LambdaExtensionConfig , error ) {
@@ -52,7 +52,6 @@ func GetConfig() (*LambdaExtensionConfig, error) {
52
52
LambdaRegion : os .Getenv ("AWS_REGION" ),
53
53
SourceCategoryOverride : os .Getenv ("SOURCE_CATEGORY_OVERRIDE" ),
54
54
MaxRetryAttempts : 5 ,
55
- RetrySleepTime : 300 * time .Millisecond ,
56
55
ConnectionTimeoutValue : 10000 * time .Millisecond ,
57
56
MaxDataPayloadSize : 1024 * 1024 , // 1 MB
58
57
}
@@ -68,12 +67,13 @@ func GetConfig() (*LambdaExtensionConfig, error) {
68
67
}
69
68
func (cfg * LambdaExtensionConfig ) setDefaults () {
70
69
numRetry := os .Getenv ("SUMO_NUM_RETRIES" )
71
- processingSleepTime := os .Getenv ("SUMO_PROCESSING_SLEEP_TIME_MS " )
70
+ retrySleepTime := os .Getenv ("SUMO_RETRY_SLEEP_TIME_MS " )
72
71
logLevel := os .Getenv ("SUMO_LOG_LEVEL" )
73
72
maxDataQueueLength := os .Getenv ("SUMO_MAX_DATAQUEUE_LENGTH" )
74
73
maxConcurrentRequests := os .Getenv ("SUMO_MAX_CONCURRENT_REQUESTS" )
75
74
enableFailover := os .Getenv ("SUMO_ENABLE_FAILOVER" )
76
75
logTypes := os .Getenv ("SUMO_LOG_TYPES" )
76
+
77
77
if numRetry == "" {
78
78
cfg .NumRetry = 3
79
79
}
@@ -94,12 +94,12 @@ func (cfg *LambdaExtensionConfig) setDefaults() {
94
94
cfg .AWSLambdaRuntimeAPI = "127.0.0.1:9001"
95
95
}
96
96
if logTypes == "" {
97
- cfg .LogTypes = validLogTypes
97
+ cfg .LogTypes = defaultLogTypes
98
98
} else {
99
99
cfg .LogTypes = strings .Split (logTypes , "," )
100
100
}
101
- if processingSleepTime == "" {
102
- cfg .ProcessingSleepTime = 0 * time .Millisecond
101
+ if retrySleepTime == "" {
102
+ cfg .RetrySleepTime = 300 * time .Millisecond
103
103
}
104
104
105
105
}
@@ -110,7 +110,7 @@ func (cfg *LambdaExtensionConfig) validateConfig() error {
110
110
maxDataQueueLength := os .Getenv ("SUMO_MAX_DATAQUEUE_LENGTH" )
111
111
maxConcurrentRequests := os .Getenv ("SUMO_MAX_CONCURRENT_REQUESTS" )
112
112
enableFailover := os .Getenv ("SUMO_ENABLE_FAILOVER" )
113
- processingSleepTime := os .Getenv ("SUMO_PROCESSING_SLEEP_TIME_MS " )
113
+ retrySleepTime := os .Getenv ("SUMO_RETRY_SLEEP_TIME_MS " )
114
114
115
115
var allErrors []string
116
116
var err error
@@ -152,12 +152,12 @@ func (cfg *LambdaExtensionConfig) validateConfig() error {
152
152
}
153
153
}
154
154
155
- if processingSleepTime != "" {
156
- customProcessingSleepTime , err := strconv .ParseInt (processingSleepTime , 10 , 32 )
155
+ if retrySleepTime != "" {
156
+ customRetrySleepTime , err := strconv .ParseInt (retrySleepTime , 10 , 32 )
157
157
if err != nil {
158
- allErrors = append (allErrors , fmt .Sprintf ("Unable to parse SUMO_PROCESSING_SLEEP_TIME_MS : %v" , err ))
158
+ allErrors = append (allErrors , fmt .Sprintf ("Unable to parse SUMO_RETRY_SLEEP_TIME_MS : %v" , err ))
159
159
} else {
160
- cfg .ProcessingSleepTime = time .Duration (customProcessingSleepTime ) * time .Millisecond
160
+ cfg .RetrySleepTime = time .Duration (customRetrySleepTime ) * time .Millisecond
161
161
}
162
162
}
163
163
0 commit comments