Merge pull request #1474 from mempool/nymkappa/bugfix/cache-warmer-pool-slug
Use slugs in cache warmer
This commit is contained in:
		
						commit
						796db0de4b
					
				| @ -321,7 +321,7 @@ LIQUIDTESTNET_ASSET_REGISTRY_DB_NAME=asset_registry_testnet_db | |||||||
| # packages needed for mempool ecosystem | # packages needed for mempool ecosystem | ||||||
| DEBIAN_PKG=() | DEBIAN_PKG=() | ||||||
| DEBIAN_PKG+=(zsh vim curl screen openssl python3) | DEBIAN_PKG+=(zsh vim curl screen openssl python3) | ||||||
| DEBIAN_PKG+=(build-essential git git-lfs clang cmake) | DEBIAN_PKG+=(build-essential git git-lfs clang cmake jq) | ||||||
| DEBIAN_PKG+=(autotools-dev autoconf automake pkg-config bsdmainutils) | DEBIAN_PKG+=(autotools-dev autoconf automake pkg-config bsdmainutils) | ||||||
| DEBIAN_PKG+=(libevent-dev libdb-dev libssl-dev libtool-dev autotools-dev) | DEBIAN_PKG+=(libevent-dev libdb-dev libssl-dev libtool-dev autotools-dev) | ||||||
| DEBIAN_PKG+=(libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev) | DEBIAN_PKG+=(libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev) | ||||||
| @ -330,7 +330,7 @@ DEBIAN_PKG+=(nodejs npm mariadb-server nginx-core python-certbot-nginx rsync ufw | |||||||
| # packages needed for mempool ecosystem | # packages needed for mempool ecosystem | ||||||
| FREEBSD_PKG=() | FREEBSD_PKG=() | ||||||
| FREEBSD_PKG+=(zsh sudo git screen curl wget calc neovim) | FREEBSD_PKG+=(zsh sudo git screen curl wget calc neovim) | ||||||
| FREEBSD_PKG+=(openssh-portable py38-pip rust llvm90) | FREEBSD_PKG+=(openssh-portable py38-pip rust llvm90 jq) | ||||||
| FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc libevent libtool pkgconf) | FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc libevent libtool pkgconf) | ||||||
| FREEBSD_PKG+=(nginx rsync py38-certbot-nginx mariadb105-server keybase) | FREEBSD_PKG+=(nginx rsync py38-certbot-nginx mariadb105-server keybase) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,7 @@ | |||||||
| #!/usr/bin/env zsh | #!/usr/bin/env zsh | ||||||
| hostname=$(hostname) | hostname=$(hostname) | ||||||
|  | slugs=(`curl -sSL https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json | jq -r '.slugs[]'`) | ||||||
|  | 
 | ||||||
| while true | while true | ||||||
| do for url in / \ | do for url in / \ | ||||||
| 	'/api/v1/statistics/2h' \ | 	'/api/v1/statistics/2h' \ | ||||||
| @ -39,12 +41,10 @@ do for url in / \ | |||||||
| 		curl -s "https://${hostname}${url}" >/dev/null | 		curl -s "https://${hostname}${url}" >/dev/null | ||||||
| 	done | 	done | ||||||
| 
 | 
 | ||||||
| 	counter=1 | 	for slug in $slugs | ||||||
| 	while [ $counter -le 134 ] |  | ||||||
| 	do | 	do | ||||||
| 		curl -s "https://${hostname}/api/v1/mining/pool/${counter}/hashrate" >/dev/null | 		curl -s "https://${hostname}/api/v1/mining/pool/${slug}/hashrate" >/dev/null | ||||||
| 		curl -s "https://${hostname}/api/v1/mining/pool/${counter}" >/dev/null | 		curl -s "https://${hostname}/api/v1/mining/pool/${slug}" >/dev/null | ||||||
| 		((counter++)) |  | ||||||
| 	done | 	done | ||||||
| 
 | 
 | ||||||
| 	sleep 10 | 	sleep 10 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user