mirror of
				https://github.com/1Panel-dev/1Panel.git
				synced 2025-10-31 11:15:58 +08:00 
			
		
		
		
	fix: 解决网站日志切割失败的问题 (#3573)
This commit is contained in:
		
							parent
							
								
									48713b51f1
								
							
						
					
					
						commit
						cb85860ff6
					
				
					 2 changed files with 1 additions and 5 deletions
				
			
		|  | @ -7,7 +7,6 @@ import ( | |||
| 	"path" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| 	"sync" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/1Panel-dev/1Panel/backend/buserr" | ||||
|  | @ -351,8 +350,6 @@ func (u *CronjobService) handleCutWebsiteLog(cronjob *model.Cronjob, startTime t | |||
| 	} | ||||
| 	baseDir := path.Join(nginx.GetPath(), "www", "sites") | ||||
| 	fileOp := files.NewFileOp() | ||||
| 	var wg sync.WaitGroup | ||||
| 	wg.Add(len(websites)) | ||||
| 	for _, website := range websites { | ||||
| 		websiteLogDir := path.Join(baseDir, website.Alias, "log") | ||||
| 		srcAccessLogPath := path.Join(websiteLogDir, "access.log") | ||||
|  | @ -380,7 +377,6 @@ func (u *CronjobService) handleCutWebsiteLog(cronjob *model.Cronjob, startTime t | |||
| 		global.LOG.Infof(msg) | ||||
| 		msgs = append(msgs, msg) | ||||
| 	} | ||||
| 	wg.Wait() | ||||
| 	u.HandleRmExpired("LOCAL", "", "", cronjob, nil) | ||||
| 	return msgs, strings.Join(filePaths, ","), err | ||||
| } | ||||
|  |  | |||
|  | @ -238,7 +238,7 @@ func (u *DatabaseService) Delete(req dto.DatabaseDelete) error { | |||
| 				return err | ||||
| 			} | ||||
| 		} else { | ||||
| 			if err := postgresqlRepo.Delete(context.Background(), mysqlRepo.WithByMysqlName(db.Name)); err != nil && !req.ForceDelete { | ||||
| 			if err := postgresqlRepo.Delete(context.Background(), postgresqlRepo.WithByPostgresqlName(db.Name)); err != nil && !req.ForceDelete { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue