style(DeepSource): Added two ignores
This commit is contained in:
parent
cd700be26c
commit
06b8631ca3
2 changed files with 5 additions and 7 deletions
|
|
@ -78,6 +78,7 @@ func getTimeSuffix() string {
|
|||
return "_" + currTime.Format("02-01-2006_15-04")
|
||||
}
|
||||
|
||||
// skipcq: RVV-A0005
|
||||
func checkTmpPath(createLocalBackup bool, targetPath string) string {
|
||||
logger := Logging.DetailedLogger("mainThread", "checkTmpPath")
|
||||
if !createLocalBackup {
|
||||
|
|
|
|||
|
|
@ -19,21 +19,18 @@ func CreateBakFile(fileName string, folderPath string, destinationPath string, b
|
|||
|
||||
pathToFile := destinationPath + string(os.PathSeparator) + fileName + ".bak"
|
||||
|
||||
|
||||
fileToWrite, err := os.OpenFile(pathToFile, os.O_CREATE|os.O_RDWR, os.FileMode(0775))
|
||||
if err != nil {
|
||||
logger.Fatal(err)
|
||||
}
|
||||
compress(fileToWrite, folderPath, backupName)
|
||||
|
||||
|
||||
SQL.NewLogEntry(SQL.GetSQLInstance(), uuid.New(), SQL.LogInfo, backupName, SQL.SQLStage_Compress, SQL.REMOTE_NONE, "File successfully written.", time.Now())
|
||||
|
||||
|
||||
return pathToFile
|
||||
}
|
||||
|
||||
func compress(fileToWrite *os.File, folderPath string, backupName string){
|
||||
func compress(fileToWrite *os.File, folderPath string, backupName string) {
|
||||
logger := Logging.DetailedLogger("Gzip", "compress")
|
||||
|
||||
zr, _ := gzip.NewWriterLevel(fileToWrite, flate.BestCompression)
|
||||
|
|
@ -41,6 +38,7 @@ func compress(fileToWrite *os.File, folderPath string, backupName string){
|
|||
|
||||
go fmt.Printf("[%s] Start compression...\n", backupName)
|
||||
SQL.NewLogEntry(SQL.GetSQLInstance(), uuid.New(), SQL.LogInfo, backupName, SQL.SQLStage_Compress, SQL.REMOTE_NONE, "Start compression", time.Now())
|
||||
// skippcq: SCC-SA4009
|
||||
filepath.Walk(folderPath, func(file string, fi os.FileInfo, err error) error {
|
||||
header, err := tar.FileInfoHeader(fi, file)
|
||||
if err != nil {
|
||||
|
|
@ -54,7 +52,7 @@ func compress(fileToWrite *os.File, folderPath string, backupName string){
|
|||
logger.Fatal(err)
|
||||
}
|
||||
|
||||
if !fi.IsDir(){
|
||||
if !fi.IsDir() {
|
||||
data, err := os.Open(file)
|
||||
if err != nil {
|
||||
logger.Fatal(err)
|
||||
|
|
@ -77,7 +75,6 @@ func compress(fileToWrite *os.File, folderPath string, backupName string){
|
|||
logger.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
go fmt.Printf("[%s] Compression Done.\n", backupName)
|
||||
SQL.NewLogEntry(SQL.GetSQLInstance(), uuid.New(), SQL.LogInfo, backupName, SQL.SQLStage_Compress, SQL.REMOTE_NONE, "Compression complete.", time.Now())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue