Skip to content

Commit 8cb4933

Browse files
committed
flag errors
1 parent 44c2ef7 commit 8cb4933

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Routines.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ func (s *SESSION) GoDownsRoutine(wid int, provider *Provider, item *segmentChanI
175175
startArticle := time.Now()
176176
code, msg, rxb, err := CMD(connitem, item, cmdARTICLE)
177177
if err != nil {
178-
dlog(always, "ERROR in GoDownsRoutine: CMD_ARTICLE seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
179-
// handle connection problem / closed connection
178+
// connection problem, closed?
180179
item.FlagError(provider.id)
181180
provider.ConnPool.CloseConn(connitem, sharedCC) // close conn on error
181+
dlog(always, "ERROR in GoDownsRoutine: CMD_ARTICLE seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
182182
return 0, fmt.Errorf("error in GoDownsRoutine: CMD_ARTICLE seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
183183
}
184184

@@ -351,9 +351,10 @@ func (s *SESSION) GoReupsRoutine(wid int, provider *Provider, item *segmentChanI
351351
} else if provider.capabilities.ihave {
352352
cmd = 2
353353
} else {
354-
//provider.mux.RUnlock() // FIXME TODO #b8bd287b:
354+
// connection problem, closed?
355+
item.FlagError(provider.id)
355356
provider.ConnPool.CloseConn(connitem, sharedCC) // close conn on error
356-
return 0, fmt.Errorf("WARN selecting upload mode failed '%s' caps='%#v'", provider.Name, provider.capabilities)
357+
return 0, fmt.Errorf("selecting upload mode failed '%s' caps='%#v'", provider.Name, provider.capabilities)
357358
}
358359
//provider.mux.RUnlock() // FIXME TODO #b8bd287b:
359360

@@ -499,9 +500,10 @@ func (s *SESSION) GoReupsRoutine(wid int, provider *Provider, item *segmentChanI
499500
}
500501

501502
if err != nil {
502-
dlog(always, "ERROR in GoReupsRoutine: seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
503503
// handle connection problem / closed connection
504+
item.FlagError(provider.id)
504505
provider.ConnPool.CloseConn(connitem, sharedCC) // close conn on error
506+
dlog(always, "ERROR in GoReupsRoutine: seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
505507
return 0, fmt.Errorf("error in GoReupsRoutine: seg.Id='%s' @ '%s'#'%s' err='%v'", item.segment.Id, provider.Name, provider.Group, err)
506508
}
507509

Workers.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ func (s *SESSION) GoWorker(wid int, provider *Provider, waitWorker *sync.WaitGro
203203
item.PrintItemFlags(cfg.opt.DebugFlags, true, fmt.Sprintf("post-GoCheckRoutine: code=%d", code))
204204
if err != nil { // re-queue?
205205
dlog(always, "ERROR in GoCheckRoutine err='%v'", err)
206-
item.FlagError(provider.id)
207206
}
208207
case true:
209208
log.Fatal("you should not be here! Quitting...") // FIXME TODO: remove this fatal error
@@ -246,7 +245,6 @@ func (s *SESSION) GoWorker(wid int, provider *Provider, waitWorker *sync.WaitGro
246245
// 430 is a normal error code for GoDownsRoutine, so we don't log it as an error
247246
errStr = fmt.Sprintf("ERROR in GoDownsRoutine code='%d' err='%v'. no retry", code, err)
248247
dlog(always, "%s", errStr)
249-
item.FlagError(provider.id) // mark item with error for this provider
250248
}
251249
memlim.MemReturn("MemRetOnERR: "+errStr, item) // memfree GoDownsRoutine on error
252250
continue forGoDownsRoutine
@@ -310,7 +308,6 @@ func (s *SESSION) GoWorker(wid int, provider *Provider, waitWorker *sync.WaitGro
310308
errStr := fmt.Sprintf("ERROR in GoReupsRoutine code='%d' err='%v' no retry", code, err)
311309
dlog(always, "%s", errStr)
312310
memlim.MemReturn("MemRetOnERR: "+errStr, item) // memfree GoReupsRoutine on error
313-
item.FlagError(provider.id) // mark item with error for this provider
314311
continue forGoReupsRoutine
315312
}
316313
speedInKBytes := (float64(item.size) / 1024) / float64(time.Since(StartReUps).Seconds())

0 commit comments

Comments
 (0)