fix build errors
This commit is contained in:
parent
88abec1d61
commit
2a10ceca38
|
@ -90,7 +90,7 @@ func (b *BackBalze) Sync(ctx context.Context) error {
|
||||||
if b.filePath != "" {
|
if b.filePath != "" {
|
||||||
log.Println("file:", b.filePath)
|
log.Println("file:", b.filePath)
|
||||||
|
|
||||||
if _, err := copyFile(ctx, bc, b.filePath); err != nil {
|
if err := copyFile(ctx, bc, b.filePath); err != nil {
|
||||||
return fmt.Errorf("copyFile %w", err)
|
return fmt.Errorf("copyFile %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -120,12 +120,11 @@ func (b *BackBalze) Sync(ctx context.Context) error {
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
for src := range fileChan {
|
for src := range fileChan {
|
||||||
msg, err := copyFile(ctx, bc, src)
|
err := copyFile(ctx, bc, src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error copying file %s: %v\n", src, err)
|
log.Printf("error copying file %s: %v\n", src, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
msgsChan <- msg
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
@ -187,7 +186,7 @@ func (b *BackBalze) OldSync() error {
|
||||||
if b.filePath != "" {
|
if b.filePath != "" {
|
||||||
log.Println("file:", b.filePath)
|
log.Println("file:", b.filePath)
|
||||||
|
|
||||||
if _, err := copyFile(ctx, bc, b.filePath); err != nil {
|
if err := copyFile(ctx, bc, b.filePath); err != nil {
|
||||||
return fmt.Errorf("copyFile %w", err)
|
return fmt.Errorf("copyFile %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -223,7 +222,7 @@ func (b *BackBalze) OldSync() error {
|
||||||
}
|
}
|
||||||
if err := uploadSem.Acquire(ctx, weight); err == nil {
|
if err := uploadSem.Acquire(ctx, weight); err == nil {
|
||||||
log.Println("start copying file", src)
|
log.Println("start copying file", src)
|
||||||
if _, err := copyFile(ctx, bc, src); err != nil {
|
if err := copyFile(ctx, bc, src); err != nil {
|
||||||
log.Printf("error copying file %s: %v\n", src, err)
|
log.Printf("error copying file %s: %v\n", src, err)
|
||||||
}
|
}
|
||||||
uploadSem.Release(weight)
|
uploadSem.Release(weight)
|
||||||
|
|
Loading…
Reference in New Issue