mirror of
				https://github.com/terorie/od-database-crawler.git
				synced 2025-10-31 13:26:51 +00:00 
			
		
		
		
	Ignore all HTTP errors
This commit is contained in:
		
							parent
							
								
									a71157b4d8
								
							
						
					
					
						commit
						6e6a4edd27
					
				
							
								
								
									
										10
									
								
								worker.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								worker.go
									
									
									
									
									
								
							| @ -42,15 +42,11 @@ func (w WorkerContext) step(results chan<- File, job Job) { | |||||||
| 
 | 
 | ||||||
| 		if httpErr, ok := err.(*HttpError); ok { | 		if httpErr, ok := err.(*HttpError); ok { | ||||||
| 			switch httpErr.code { | 			switch httpErr.code { | ||||||
| 			case |  | ||||||
| 				fasthttp.StatusMovedPermanently, |  | ||||||
| 				fasthttp.StatusFound, |  | ||||||
| 				fasthttp.StatusUnauthorized, |  | ||||||
| 				fasthttp.StatusForbidden, |  | ||||||
| 				fasthttp.StatusNotFound: |  | ||||||
| 				return |  | ||||||
| 			case fasthttp.StatusTooManyRequests: | 			case fasthttp.StatusTooManyRequests: | ||||||
| 				err = ErrRateLimit | 				err = ErrRateLimit | ||||||
|  | 			default: | ||||||
|  | 				// Don't retry HTTP error codes | ||||||
|  | 				return | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user