| | |
| | | t := task |
| | | safe.Go(func() { |
| | | if err := model.Init(t); err != nil { |
| | | logger.Warnf("Init task %s. %s", t.Name, err.Error()) |
| | | return |
| | | } |
| | | if err := model.Run(); err != nil { |
| | | logger.Warnf("Run task %s. %s", t.Name, err.Error()) |
| | | return |
| | | } |
| | | if err := model.Shutdown(); err != nil { |
| | |
| | | if len(ageFilter) == 0 { |
| | | return fmt.Errorf("no results found that match the age condition %d", m.PersonAge) |
| | | } |
| | | |
| | | logger.Debugf("match age result %d", len(ageFilter)) |
| | | } |
| | | |
| | | if m.PersonLabel != "" { |
| | |
| | | if len(labelFilter) == 0 { |
| | | return fmt.Errorf("no results found that match the label condition %s", m.PersonLabel) |
| | | } |
| | | |
| | | logger.Debugf("match label result %d", len(labelFilter)) |
| | | } |
| | | |
| | | // 合并一下条件 |
| | |
| | | if err != nil { |
| | | logger.Warnf(err.Error()) |
| | | } |
| | | |
| | | logger.Debugf("match key person result %d", len(keyFilter)) |
| | | } |
| | | |
| | | if len(lastFilter) > 0 { |
| | |
| | | lastFilter = keyFilter |
| | | } |
| | | |
| | | logger.Debugf("last result %d", len(lastFilter)) |
| | | for _, p := range lastFilter { |
| | | if len(m.AreaIds) > 0 { |
| | | _, o1 := m.AreaIds[p.CommunityId] |