@@ -21,28 +21,26 @@ func (u *Uploader) Copy(additionalRcloneParams []string) error {
2121 for _ , remotePath := range u .Config .Remotes .Copy {
2222 // set variables
2323 attempts := 1
24- rLog := u .Log .WithFields (logrus.Fields {
25- "copy_remote" : remotePath ,
26- "copy_local_path" : u .Config .LocalFolder ,
27- "attempts" : attempts ,
28- })
2924
3025 // copy to remote
3126 for {
32- // get service account file
27+ // set log
28+ rLog := u .Log .WithFields (logrus.Fields {
29+ "copy_remote" : remotePath ,
30+ "copy_local_path" : u .Config .LocalFolder ,
31+ "attempts" : attempts ,
32+ })
33+
34+ // get service account(s)
3335 serviceAccounts , err := u .RemoteServiceAccountFiles .GetServiceAccount (remotePath )
3436 if err != nil {
3537 return errors .WithMessagef (err ,
3638 "aborting further copy attempts of %q due to serviceAccount exhaustion" ,
3739 u .Config .LocalFolder )
38- } else if len (serviceAccounts ) > 0 {
39- // reset log
40- rLog = u .Log .WithFields (logrus.Fields {
41- "copy_remote" : remotePath ,
42- "copy_local_path" : u .Config .LocalFolder ,
43- "attempts" : attempts ,
44- })
40+ }
4541
42+ // display service account(s) being used
43+ if len (serviceAccounts ) > 0 {
4644 for _ , sa := range serviceAccounts {
4745 rLog .Infof ("Using service account %q: %v" , sa .RemoteEnvVar , sa .ServiceAccountPath )
4846 }
@@ -75,7 +73,7 @@ func (u *Uploader) Copy(additionalRcloneParams []string) error {
7573 return fmt .Errorf ("copy failed with exit code: %v" , exitCode )
7674 }
7775
78- // ban service account(s)
76+ // ban service account(s) used
7977 for _ , sa := range serviceAccounts {
8078 if err := cache .Set (sa .ServiceAccountPath , time .Now ().UTC ().Add (25 * time .Hour )); err != nil {
8179 rLog .WithError (err ).Error ("Failed banning service account, cannot try again..." )
0 commit comments