mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	markdown: Cache Twitter 403 responses that are semi-permanent.
03ca3afbc2 added more codes that are equivalent to 404's; this adds to
the list of cache-as-None codes a couple which are equivalent to
403's.  It does not comprise _all_ possible 403-like codes -- many of
them are "the client is not OK," which is relevant to log as an error
still.
			
			
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							13e0c7454e
						
					
				
				
					commit
					092ed87ae3
				
			@@ -419,6 +419,10 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:
 | 
			
		||||
                    # that the message doesn't exist; return None so
 | 
			
		||||
                    # that we will cache the error.
 | 
			
		||||
                    return None
 | 
			
		||||
                elif code in [63, 179]:
 | 
			
		||||
                    # 63 is that the account is suspended, 179 is that
 | 
			
		||||
                    # it is now locked; cache the None.
 | 
			
		||||
                    return None
 | 
			
		||||
                elif code in [88, 130]:
 | 
			
		||||
                    # Code 88 means that we were rate-limited and 130
 | 
			
		||||
                    # means Twitter is having capacity issues; either way
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user