You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
425 B
24 lines
425 B
package goblin |
|
|
|
import ( |
|
"time" |
|
|
|
"go-common/library/log" |
|
) |
|
|
|
// reload hotword data from MC |
|
func (s *Service) loadHotword() { |
|
var err error |
|
if s.Hotword, err = s.dao.Hotword(ctx); err != nil { |
|
log.Error("loadHotword Error %v, List %v", err, s.Hotword) |
|
return |
|
} |
|
} |
|
|
|
// load hotword data regularly |
|
func (s *Service) loadHotwordproc() { |
|
for { |
|
time.Sleep(time.Duration(s.conf.Search.HotwordFre)) |
|
s.loadHotword() |
|
} |
|
}
|
|
|