@@ -165,6 +165,7 @@ func (ss *strategyStore) updateStrategy(tx *bolt.Tx, modify *model.ModifyStrateg
165165 computeResources (false , modify .AddResources , saveVal )
166166 computeResources (true , modify .RemoveResources , saveVal )
167167
168+ saveVal .ModifyTime = time .Now ()
168169 if err := saveValue (tx , tblStrategy , saveVal .ID , saveVal ); err != nil {
169170 logger .StoreScope ().Error ("[Store][Strategy] update auth_strategy" , zap .Error (err ),
170171 zap .String ("id" , saveVal .ID ))
@@ -279,6 +280,7 @@ func (ss *strategyStore) operateStrategyResources(remove bool, resources []model
279280 }
280281
281282 computeResources (remove , ress , rule )
283+ rule .ModifyTime = time .Now ()
282284 if err := saveValue (tx , tblStrategy , rule .ID , rule ); err != nil {
283285 logger .StoreScope ().Error ("[Store][Strategy] operate strategy resource" , zap .Error (err ),
284286 zap .Bool ("remove" , remove ), zap .String ("id" , id ))
@@ -669,6 +671,10 @@ func comparePrincipalExist(principalType, principalId string, m map[string]inter
669671func (ss * strategyStore ) GetStrategyDetailsForCache (mtime time.Time ,
670672 firstUpdate bool ) ([]* model.StrategyDetail , error ) {
671673
674+ if firstUpdate {
675+ mtime = time.Time {}
676+ }
677+
672678 ret , err := ss .handler .LoadValuesByFilter (tblStrategy , []string {StrategyFieldModifyTime }, & strategyForStore {},
673679 func (m map [string ]interface {}) bool {
674680 mt := m [StrategyFieldModifyTime ].(time.Time )
0 commit comments