Skip to content
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

try using aider to refactor #613

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

try using aider to refactor #613

wants to merge 25 commits into from

Conversation

swuecho
Copy link
Owner

@swuecho swuecho commented Feb 27, 2025

No description provided.

@swuecho
Copy link
Owner Author

swuecho commented Feb 27, 2025

 <<<<<<< SEARCH                                                                                                                                                                                
     rate, err := h.service.q.RateLimiteByUserAndSessionUUID(ctx,                                                                                                                              
         sqlc_queries.RateLimiteByUserAndSessionUUIDParams{                                                                                                                                    
             Uuid:   chatSessionUuid,                                                                                                                                                          
             UserID: userID,                                                                                                                                                                   
         })                                                                                                                                                                                    
     log.Printf("%+v", rate)                                                                                                                                                                   
     if err != nil {                                                                                                                                                                           
         apiErr := ErrInternalUnexpected                                                                                                                                                       
         apiErr.Detail = "Failed to get rate limit"                                                                                                                                            
         apiErr.DebugInfo = err.Error()                                                                                                                                                        
         RespondWithAPIError(w, apiErr)                                                                                                                                                        
         return true                                                                                                                                                                           
     }                                                                                                                                                                                         
 =======                                                                                                                                                                                       
     rate, err := h.service.q.RateLimiteByUserAndSessionUUID(ctx,                                                                                                                              
         sqlc_queries.RateLimiteByUserAndSessionUUIDParams{                                                                                                                                    
             Uuid:   chatSessionUuid,                                                                                                                                                          
             UserID: userID,                                                                                                                                                                   
         })                                                                                                                                                                                    
     log.Printf("%+v", rate)                                                                                                                                                                   
     if err != nil {                                                                                                                                                                           
         if errors.Is(err, sql.ErrNoRows) {                                                                                                                                                    
             // If no rate limit is found, use a default value instead of returning an error                                                                                                   
             log.Printf("No rate limit found for user %d and session %s, using default", userID, chatSessionUuid)                                                                              
             return false                                                                                                                                                                      
         }                                                                                                                                                                                     
                                                                                                                                                                                               
         apiErr := WrapError(MapDatabaseError(err), "Failed to get rate limit")                                                                                                                
         RespondWithAPIError(w, apiErr)                                                                                                                                                        
         return true                                                                                                                                                                           
     }                                                                                                                                                                                         
 >>>>>>> REPLACE    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant