|
@ -131,9 +131,14 @@ func isInTimeOfDay(t time.Time, ta TimeArrow) bool { |
|
|
mainKey := fmt.Sprintf("[%s][%s]", tfdate, strings.Join(ta.TimesOnDay, "|")) |
|
|
mainKey := fmt.Sprintf("[%s][%s]", tfdate, strings.Join(ta.TimesOnDay, "|")) |
|
|
value, ok := isInTimeOfDayCacheBool.Load(mainKey) |
|
|
value, ok := isInTimeOfDayCacheBool.Load(mainKey) |
|
|
if ok { |
|
|
if ok { |
|
|
ret, ok := value.(bool) |
|
|
|
|
|
|
|
|
ret, ok := value.(int) |
|
|
if ok { |
|
|
if ok { |
|
|
return ret |
|
|
|
|
|
|
|
|
if ret == 1 { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
if ret == 2 { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -193,11 +198,11 @@ func isInTimeOfDay(t time.Time, ta TimeArrow) bool { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (t.After(startTime) || t.Equal(startTime)) && t.Before(endTime) { |
|
|
if (t.After(startTime) || t.Equal(startTime)) && t.Before(endTime) { |
|
|
isInTimeOfDayCacheBool.Store(mainKey, true) |
|
|
|
|
|
|
|
|
isInTimeOfDayCacheBool.Store(mainKey, 1) |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
isInTimeOfDayCacheBool.Store(mainKey, false) |
|
|
|
|
|
|
|
|
isInTimeOfDayCacheBool.Store(mainKey, 2) |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|