go/trains: ease up on some crashy behaviour
This commit is contained in:
parent
ec5af85046
commit
5f0326b484
2 changed files with 12 additions and 3 deletions
|
@ -120,8 +120,11 @@ RETURNING id, effective_start_time
|
||||||
return fmt.Errorf("RID %v/my ID %v at TIPLOC %v: failed to update with query %q: %w", ts.RID, tsid, l.TIPLOC, query, err)
|
return fmt.Errorf("RID %v/my ID %v at TIPLOC %v: failed to update with query %q: %w", ts.RID, tsid, l.TIPLOC, query, err)
|
||||||
}
|
}
|
||||||
a.TIPLOC(l.TIPLOC)
|
a.TIPLOC(l.TIPLOC)
|
||||||
if cmd.RowsAffected() != 1 {
|
if cmd.RowsAffected() > 1 {
|
||||||
return fmt.Errorf("RID %v/my ID %v at TIPLOC %v: query %q: wanted to update 1 row, updated %d", ts.RID, tsid, l.TIPLOC, query, cmd.RowsAffected())
|
return fmt.Errorf("RID %v/my ID %v at TIPLOC %v: query %q: wanted to update 1 row, updated %d", ts.RID, tsid, l.TIPLOC, query, cmd.RowsAffected())
|
||||||
|
} else if cmd.RowsAffected() == 0 {
|
||||||
|
log.Printf("RID %v/my ID %v at TIPLOC %v: query %q: wanted to update 1 row, updated %d", ts.RID, tsid, l.TIPLOC, query, cmd.RowsAffected())
|
||||||
|
// non-fatal :((
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("t")
|
fmt.Printf("t")
|
||||||
|
|
|
@ -252,11 +252,17 @@ func run(ctx context.Context, bucket *blob.Bucket, cfg Config, runCatchup bool)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
log.Printf("resubscribing...")
|
log.Printf("resubscribing...")
|
||||||
|
if stompConn != nil {
|
||||||
sub, err = cfg.StompSubscribe(ctx, stompConn)
|
sub, err = cfg.StompSubscribe(ctx, stompConn)
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("no stompConn")
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("StompSubscribe while resubscribing: %v", err)
|
log.Printf("StompSubscribe while resubscribing: %v", err)
|
||||||
// Force close the server connection and dial again.
|
// Force close the server connection and dial again.
|
||||||
|
if stompConn != nil {
|
||||||
stompConn.MustDisconnect()
|
stompConn.MustDisconnect()
|
||||||
|
}
|
||||||
stompConn, err = cfg.DialStomp(ctx)
|
stompConn, err = cfg.DialStomp(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("DialStomp failed as well :(")
|
log.Printf("DialStomp failed as well :(")
|
||||||
|
|
Loading…
Reference in a new issue