- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6.2k
 
Fix get system setting bug when enabled redis cache #22295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            lunny
  merged 4 commits into
  go-gitea:main
from
lunny:lunny/fix_system_setting_redis_cache
  
      
      
   
  Jan 1, 2023 
      
    
                
     Merged
            
            Fix get system setting bug when enabled redis cache #22295
                    lunny
  merged 4 commits into
  go-gitea:main
from
lunny:lunny/fix_system_setting_redis_cache
  
      
      
   
  Jan 1, 2023 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
          Codecov Report
 @@           Coverage Diff           @@
##             main   #22295   +/-   ##
=======================================
  Coverage        ?   48.18%           
=======================================
  Files           ?     1043           
  Lines           ?   142378           
  Branches        ?        0           
=======================================
  Hits            ?    68602           
  Misses          ?    65596           
  Partials        ?     8180           
 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.  | 
    
              
                    lafriks
  
              
              approved these changes
              
                  
                    Dec 31, 2022 
                  
              
              
            
            
              
                    lafriks
  
              
              approved these changes
              
                  
                    Dec 31, 2022 
                  
              
              
            
            
              
                    delvh
  
              
              approved these changes
              
                  
                    Jan 1, 2023 
                  
              
              
            
            
    
  lunny 
      added a commit
      that referenced
      this pull request
    
      Jan 1, 2023 
    
    
  
              
                    yardenshoham
  
              
              approved these changes
              
                  
                    Jan 1, 2023 
                  
              
              
            
            
    
  zjjhot 
      added a commit
        to zjjhot/gitea
      that referenced
      this pull request
    
      Jan 3, 2023 
    
    
      
  
    
      
    
  
* upstream/main: Add deprecated warning for DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR (go-gitea#22318) Unify hashing for avatar (go-gitea#22289) fix: code search title translation (go-gitea#22285) Update Gmail mailer configuration (go-gitea#22291) Fix due date rendering the wrong date in issue (go-gitea#22302) Fix get system setting bug when enabled redis cache (go-gitea#22295) Restructure `webhook` module (go-gitea#22256) Reminder for no more logs to console (go-gitea#22282) Fix bug of DisableGravatar default value (go-gitea#22296) Upgrade go-chi to v5.0.8 (go-gitea#22304) [skip ci] Updated licenses and gitignores Use ErrInvalidArgument in packages (go-gitea#22268) Changelog v1.18.0 (go-gitea#22215) (go-gitea#22269) Support estimated count with multiple schemas (go-gitea#22276) Add Gentoo to the from package providers (go-gitea#22284) Fix sitemap (go-gitea#22272) Add `sync_on_commit` option for push mirrors api (go-gitea#22271) Fix key signature error page (go-gitea#22229)
    
  lunny 
      added a commit
      that referenced
      this pull request
    
      Jan 8, 2023 
    
    
  
    
  lunny 
      added a commit
        to lunny/gitea
      that referenced
      this pull request
    
      Jan 8, 2023 
    
    
      
  
    
      
    
  
Unfortunately, go-gitea#22295 introduced a bug that when set a cached system setting, it will not affect. This PR make sure to remove the cache key when updating a system setting. Fix go-gitea#22332
  
      Sign up for free
      to subscribe to this conversation on GitHub.
      Already have an account?
      Sign in.
  
      Labels
      
    backport/done
  All backports for this PR have been created 
  
    lgtm/done
  This PR has enough approvals to get merged. There are no important open reservations anymore. 
  
    outdated/backport/v1.18
  This PR should be backported to Gitea 1.18 
  
    skip-changelog
  This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. 
  
    type/bug
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Fix #22281
In #21621 ,
Get[V]andSet[V]has been introduced, so that cache value will be*Setting. For memory cache it's OK. But for redis cache, it can only storestringfor the current implementation. This PR revert some of changes of that and just store or return astringfor system setting.