|  |  | @ -68,10 +68,12 @@ class CheckSourceService : BaseService() { | 
			
		
	
		
		
			
				
					
					|  |  |  |         synchronized(this) { |  |  |  |         synchronized(this) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             processIndex++ |  |  |  |             processIndex++ | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (processIndex < allIds.size) { |  |  |  |         execute { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             val sourceUrl = allIds[processIndex] |  |  |  |             if (processIndex < allIds.size) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             App.db.bookSourceDao().getBookSource(sourceUrl)?.let { source -> |  |  |  |                 val sourceUrl = allIds[processIndex] | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 check(source) |  |  |  |                 App.db.bookSourceDao().getBookSource(sourceUrl)?.let { source -> | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     check(source) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } ?: onNext(sourceUrl) | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | @ -83,20 +85,24 @@ class CheckSourceService : BaseService() { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 source.addGroup("失效") |  |  |  |                 source.addGroup("失效") | 
			
		
	
		
		
			
				
					
					|  |  |  |                 App.db.bookSourceDao().update(source) |  |  |  |                 App.db.bookSourceDao().update(source) | 
			
		
	
		
		
			
				
					
					|  |  |  |             }.onFinally(IO) { |  |  |  |             }.onFinally(IO) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 check() |  |  |  |                 onNext(source.bookSourceUrl) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 checkedIds.add(source.bookSourceUrl) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 updateNotification( |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     checkedIds.size, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     getString(R.string.progress_show, checkedIds.size, allIds.size) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 synchronized(this) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (processIndex >= allIds.size + threadCount - 1) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         stopSelf() |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             }) |  |  |  |             }) | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private fun onNext(sourceUrl: String) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         synchronized(this) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             check() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             checkedIds.add(sourceUrl) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             updateNotification( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 checkedIds.size, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 getString(R.string.progress_show, checkedIds.size, allIds.size) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (processIndex >= allIds.size + threadCount - 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 stopSelf() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 更新通知 |  |  |  |      * 更新通知 | 
			
		
	
		
		
			
				
					
					|  |  |  |      */ |  |  |  |      */ | 
			
		
	
	
		
		
			
				
					|  |  | 
 |