ops: Add new nginx hot cacher
This commit is contained in:
		
							parent
							
								
									5a7a78cddc
								
							
						
					
					
						commit
						b110f86b48
					
				
							
								
								
									
										24
									
								
								production/nginx-cache-heater
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										24
									
								
								production/nginx-cache-heater
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,24 @@ | ||||
| #!/usr/bin/env zsh | ||||
| hostname=mempool.space | ||||
| 
 | ||||
| heat() | ||||
| { | ||||
|        echo "$1" | ||||
|        curl -i -s "$1" | head -1 | ||||
| } | ||||
| 
 | ||||
| heatURLs=( | ||||
|        '/api/v1/fees/recommended' | ||||
| ) | ||||
| 
 | ||||
| while true | ||||
| do | ||||
|        echo "starting heat cache cycle..." | ||||
| 
 | ||||
|        for url in $heatURLs | ||||
|        do | ||||
|                heat "https://${hostname}${url}" | ||||
|        done | ||||
| 
 | ||||
|        sleep 0.5 | ||||
| done | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user