mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	往硬盘刷数据时不统计maxOpenFiles
This commit is contained in:
		@@ -428,7 +428,7 @@ func (this *FileStorage) openWriter(key string, expiredAt int64, status int, siz
 | 
			
		||||
		return nil, ErrFileIsWriting
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(sharedWritingFileKeyMap) >= int(maxOpenFiles.Max()) {
 | 
			
		||||
	if !isFlushing && len(sharedWritingFileKeyMap) >= int(maxOpenFiles.Max()) {
 | 
			
		||||
		sharedWritingFileKeyLocker.Unlock()
 | 
			
		||||
		return nil, ErrTooManyOpenFiles
 | 
			
		||||
	}
 | 
			
		||||
@@ -534,10 +534,12 @@ func (this *FileStorage) openWriter(key string, expiredAt int64, status int, siz
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	if time.Since(before) >= maxOpenFilesSlowCost {
 | 
			
		||||
		maxOpenFiles.Slow()
 | 
			
		||||
	} else {
 | 
			
		||||
		maxOpenFiles.Fast()
 | 
			
		||||
	if !isFlushing {
 | 
			
		||||
		if time.Since(before) >= maxOpenFilesSlowCost {
 | 
			
		||||
			maxOpenFiles.Slow()
 | 
			
		||||
		} else {
 | 
			
		||||
			maxOpenFiles.Fast()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var removeOnFailure = true
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user