mirror of
				https://github.com/Qortal/qortal.git
				synced 2025-11-04 00:27:03 +00:00 
			
		
		
		
	Add initial delay before trimming online accounts signatures
This commit is contained in:
		@@ -13,6 +13,8 @@ public class OnlineAccountsSignaturesTrimmer implements Runnable {
 | 
			
		||||
 | 
			
		||||
	private static final Logger LOGGER = LogManager.getLogger(OnlineAccountsSignaturesTrimmer.class);
 | 
			
		||||
 | 
			
		||||
	private static final long INITIAL_SLEEP_PERIOD = 5 * 60 * 1000L; // ms
 | 
			
		||||
 | 
			
		||||
	private enum TrimMode { SEARCHING, TRIMMING }
 | 
			
		||||
	private static final long TRIM_INTERVAL = 2 * 1000L; // ms
 | 
			
		||||
	private static final int TRIM_SEARCH_SIZE = 5000; // blocks
 | 
			
		||||
@@ -23,6 +25,9 @@ public class OnlineAccountsSignaturesTrimmer implements Runnable {
 | 
			
		||||
 | 
			
		||||
	public void run() {
 | 
			
		||||
		try (final Repository repository = RepositoryManager.getRepository()) {
 | 
			
		||||
			// Don't even start trimming until initial rush has ended
 | 
			
		||||
			Thread.sleep(INITIAL_SLEEP_PERIOD);
 | 
			
		||||
 | 
			
		||||
			while (!Controller.isStopping()) {
 | 
			
		||||
				repository.discardChanges();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user