Skip to content

Commit ed3454d

Browse files
authoredOct 1, 2024··
Fix for backward compatibility (#13)
1 parent 53b2e58 commit ed3454d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎lambda.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func configureExtractionResolution(logger *logrus.Entry, paramReader *parameters
212212
logger.Error("Error reading parameter "+paramReader.ResolveParameter(SamplesResoStack, stack), err)
213213
}
214214
} else {
215-
resolution, err = paramReader.ReadIntConfig(SamplesReso)
215+
resolution, err = paramReader.ReadIntConfig(SamplesResoSec)
216216
if err != nil {
217217
// Possibly this parameter is not set. Try SamplesReso
218218
res, err = paramReader.ReadConfig(SamplesReso)
@@ -249,19 +249,25 @@ func configureExtractionResolution(logger *logrus.Entry, paramReader *parameters
249249
func configureDataExtractionTimeWindow(logger *logrus.Entry, paramReader *parameters.ParametersClient, stack string) (*int, error) {
250250
var schedule *string
251251
var err error
252+
extractionWindowMinutes := DefaultTimeExtractionWindowMinutes
253+
252254
if stack != "" {
253255
schedule, err = paramReader.ReadConfigByStack(SchedulingStack, stack)
254256
if err != nil {
255257
logger.Error("Error reading parameter "+paramReader.ResolveParameter(SchedulingStack, stack), err)
256258
}
257259
} else {
258260
schedule, err = paramReader.ReadConfig(Scheduling)
261+
if err != nil {
262+
// In such case, scheduling is fixed to 1 hour
263+
return &extractionWindowMinutes, nil
264+
}
259265
}
260266
if err != nil {
261267
logger.Error("Error reading parameter "+Scheduling, err)
262268
return nil, err
263269
}
264-
extractionWindowMinutes := DefaultTimeExtractionWindowMinutes
270+
265271
switch *schedule {
266272
case "5 minutes":
267273
extractionWindowMinutes = 5

0 commit comments

Comments
 (0)
Please sign in to comment.