Update cache warmer
This commit is contained in:
		
							parent
							
								
									b79fb6265c
								
							
						
					
					
						commit
						31ded69a4c
					
				@ -436,10 +436,7 @@ class BlocksRepository {
 | 
			
		||||
   * Get the historical averaged block fee rate percentiles
 | 
			
		||||
   */
 | 
			
		||||
   public async $getHistoricalBlockFeeRates(div: number, interval: string | null): Promise<any> {
 | 
			
		||||
    let connection;
 | 
			
		||||
    try {
 | 
			
		||||
      connection = await DB.getConnection();
 | 
			
		||||
 | 
			
		||||
      let query = `SELECT
 | 
			
		||||
        CAST(AVG(height) as INT) as avg_height,
 | 
			
		||||
        CAST(AVG(UNIX_TIMESTAMP(blockTimestamp)) as INT) as timestamp,
 | 
			
		||||
@ -458,12 +455,9 @@ class BlocksRepository {
 | 
			
		||||
 | 
			
		||||
      query += ` GROUP BY UNIX_TIMESTAMP(blockTimestamp) DIV ${div}`;
 | 
			
		||||
 | 
			
		||||
      const [rows]: any = await connection.query(query);
 | 
			
		||||
      connection.release();
 | 
			
		||||
 | 
			
		||||
      const [rows]: any = await DB.query(query);
 | 
			
		||||
      return rows;
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
      connection.release();
 | 
			
		||||
      logger.err('Cannot generate block fee rates history. Reason: ' + (e instanceof Error ? e.message : e));
 | 
			
		||||
      throw e;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -57,6 +57,16 @@ do for url in / \
 | 
			
		||||
	'/api/v1/mining/blocks/rewards/2y' \
 | 
			
		||||
	'/api/v1/mining/blocks/rewards/3y' \
 | 
			
		||||
	'/api/v1/mining/blocks/rewards/all' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/24h' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/3d' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/1w' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/1m' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/3m' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/6m' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/1y' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/2y' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/3y' \
 | 
			
		||||
	'/api/v1/mining/blocks/fee-rates/all' \
 | 
			
		||||
 | 
			
		||||
	do
 | 
			
		||||
		curl -s "https://${hostname}${url}" >/dev/null
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user