✨ Allow to set preferred storage destination
This commit is contained in:
		@@ -291,7 +291,11 @@ func AnalyzeAttachment(file models.Attachment) error {
 | 
				
			|||||||
	if !linked {
 | 
						if !linked {
 | 
				
			||||||
		go func() {
 | 
							go func() {
 | 
				
			||||||
			start = time.Now()
 | 
								start = time.Now()
 | 
				
			||||||
			if err := ReUploadFile(file, 1); err != nil {
 | 
								preferred := viper.GetInt("preferred_destination")
 | 
				
			||||||
 | 
								if preferred == 0 {
 | 
				
			||||||
 | 
									preferred = 1
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if err := ReUploadFile(file, preferred); err != nil {
 | 
				
			||||||
				log.Warn().Any("file", file).Err(err).Msg("Unable to move file to permanet storage...")
 | 
									log.Warn().Any("file", file).Err(err).Msg("Unable to move file to permanet storage...")
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				// Recycle the temporary file
 | 
									// Recycle the temporary file
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,8 @@ grpc_bind = "0.0.0.0:7004"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
nexus_addr = "localhost:7001"
 | 
					nexus_addr = "localhost:7001"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					preferred_destination = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[workers]
 | 
					[workers]
 | 
				
			||||||
files_deletion = 4
 | 
					files_deletion = 4
 | 
				
			||||||
files_analyze = 4
 | 
					files_analyze = 4
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user