summaryrefslogtreecommitdiff
path: root/mappers
diff options
context:
space:
mode:
authorsailorvii <challengingway@hotmail.com>2020-07-17 15:57:18 +0800
committersailorvii <challengingway@hotmail.com>2020-07-17 15:57:18 +0800
commit3ff442ebdbc2bfc4694844e0a8d2a4eca8059581 (patch)
treeb058aa5e5622383758c1e6d7f671f3db1633232a /mappers
parentMerge pull request #1910 from shashidharatd/patch-1 (diff)
downloadkubeedge-3ff442ebdbc2bfc4694844e0a8d2a4eca8059581.tar.gz
Fix issue 1824
The action in one schedule can be more than one. "actionExists" will always be true once it enters line 85, which is not expected. Morever, if one action cannot be found, other actions should be run.
Diffstat (limited to 'mappers')
-rw-r--r--mappers/bluetooth_mapper/scheduler/scheduler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/mappers/bluetooth_mapper/scheduler/scheduler.go b/mappers/bluetooth_mapper/scheduler/scheduler.go
index 380277bc0..7fd73d47a 100644
--- a/mappers/bluetooth_mapper/scheduler/scheduler.go
+++ b/mappers/bluetooth_mapper/scheduler/scheduler.go
@@ -78,8 +78,8 @@ func (schedule *Schedule) ExecuteSchedule(actionManager []actionmanager.Action,
// performScheduleOperation is responsible for performing the operations associated with the schedule
func (schedule *Schedule) performScheduleOperation(actionManager []actionmanager.Action, dataConverter dataconverter.DataRead, deviceID string) {
var scheduleResult ScheduleResult
- actionExists := false
for _, actionName := range schedule.Actions {
+ actionExists := false
for _, action := range actionManager {
if strings.EqualFold(action.Name, actionName) {
actionExists = true
@@ -95,8 +95,8 @@ func (schedule *Schedule) performScheduleOperation(actionManager []actionmanager
schedule.Interval = defaultEventFrequency
}
if !actionExists {
- klog.Errorf("Action %s does not exist. Exiting from schedule !!!", actionName)
- break
+ klog.Errorf("Action %s does not exist.", actionName)
+ continue
}
time.Sleep(time.Duration(time.Duration(schedule.Interval) * time.Millisecond))
}