u 3 years ago
parent
commit
de5b8e1533
  1. 6
      core.go

6
core.go

@ -129,11 +129,12 @@ func isInTimeOfDay(t time.Time, ta TimeArrow) bool {
tfdate := t.Format("2006-01-02 15:04:05")
tmp, _ := json.Marshal(ta.TimesOnDay)
var err error
tmp, err := json.Marshal(ta.TimesOnDay)
mainKey := fmt.Sprintf("[%s][%s]", tfdate, string(tmp))
value, ok := isInTimeOfDayCacheBool.Load(mainKey)
if ok {
if ok && err == nil {
ret := value.(int)
if ret == 3 {
return true
@ -144,7 +145,6 @@ func isInTimeOfDay(t time.Time, ta TimeArrow) bool {
}
parseInLocationCache := map[string]time.Time{}
var err error
for k := range ta.TimesOnDay {
tsp := strings.Split(ta.TimesOnDay[k], "-")
if len(tsp) < 2 {

Loading…
Cancel
Save