From 8543868eef6442fd30131d9567b66222999101e9 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Tue, 20 Jun 2023 18:21:50 +0300 Subject: [PATCH] all: upd chlog --- CHANGELOG.md | 3 +++ internal/filtering/blocked.go | 2 +- internal/schedule/schedule.go | 11 +++-------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 941c3ed6da2..c740b1e1cae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Added +- The ability to set inactivity periods for filtering blocked services per + client in the configuration file ([#951]). The UI changes are coming in the + upcoming releases. - The ability to set inactivity periods for filtering blocked services in the configuration file ([#951]). The UI changes are coming in the upcoming releases. diff --git a/internal/filtering/blocked.go b/internal/filtering/blocked.go index bbcc667a60d..88686af106f 100644 --- a/internal/filtering/blocked.go +++ b/internal/filtering/blocked.go @@ -59,7 +59,7 @@ type BlockedServices struct { func (s *BlockedServices) Clone() (c *BlockedServices) { return &BlockedServices{ Schedule: s.Schedule.Clone(), - IDs: append([]string{}, s.IDs...), + IDs: slices.Clone(s.IDs), } } diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go index 08589241179..15480cb8623 100644 --- a/internal/schedule/schedule.go +++ b/internal/schedule/schedule.go @@ -6,7 +6,6 @@ import ( "time" "github.com/AdguardTeam/golibs/errors" - "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/timeutil" "gopkg.in/yaml.v3" ) @@ -31,14 +30,10 @@ func EmptyWeekly() (w *Weekly) { // Clone returns a deep copy of a weekly. func (w *Weekly) Clone() (c *Weekly) { - tz := w.location.String() - loc, err := time.LoadLocation(tz) - if err != nil { - log.Debug("schedule: cloning location: %s", err) - } - + // NOTE: Do not use time.LoadLocation, because the results will be + // different on time zone database update. return &Weekly{ - location: loc, + location: w.location, days: w.days, } }