Reduce log spam during hashrate indexing
This commit is contained in:
		
							parent
							
								
									bb1c5d0b31
								
							
						
					
					
						commit
						537e50c682
					
				@ -111,13 +111,13 @@ class Mining {
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    logger.info(`Indexing hashrates`);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (this.hashrateIndexingStarted) {
 | 
					    if (this.hashrateIndexingStarted) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.hashrateIndexingStarted = true;
 | 
					    this.hashrateIndexingStarted = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    logger.info(`Indexing hashrates`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const totalDayIndexed = (await BlocksRepository.$blockCount(null, null)) / 144;
 | 
					    const totalDayIndexed = (await BlocksRepository.$blockCount(null, null)) / 144;
 | 
				
			||||||
    const indexedTimestamp = (await HashratesRepository.$get(null)).map(hashrate => hashrate.timestamp);
 | 
					    const indexedTimestamp = (await HashratesRepository.$get(null)).map(hashrate => hashrate.timestamp);
 | 
				
			||||||
    let startedAt = new Date().getTime() / 1000;
 | 
					    let startedAt = new Date().getTime() / 1000;
 | 
				
			||||||
@ -149,7 +149,7 @@ class Mining {
 | 
				
			|||||||
        blockStats.lastBlockHeight);
 | 
					        blockStats.lastBlockHeight);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - startedAt));
 | 
					      const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - startedAt));
 | 
				
			||||||
      if (elapsedSeconds > 1) {
 | 
					      if (elapsedSeconds > 10) {
 | 
				
			||||||
        const daysPerSeconds = Math.max(1, Math.round(indexedThisRun / elapsedSeconds));
 | 
					        const daysPerSeconds = Math.max(1, Math.round(indexedThisRun / elapsedSeconds));
 | 
				
			||||||
        const formattedDate = new Date(fromTimestamp * 1000).toUTCString();
 | 
					        const formattedDate = new Date(fromTimestamp * 1000).toUTCString();
 | 
				
			||||||
        const daysLeft = Math.round(totalDayIndexed - totalIndexed);
 | 
					        const daysLeft = Math.round(totalDayIndexed - totalIndexed);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user