diff --git a/cmd/acb-worker/b2.go b/cmd/acb-worker/b2.go index fea7561..4468cbd 100644 --- a/cmd/acb-worker/b2.go +++ b/cmd/acb-worker/b2.go @@ -45,11 +45,14 @@ func NewB2Client(cfg *Config) *B2Client { } // Create S3 client with custom endpoint (ARMOR proxy wrapping B2) - // Use custom EndpointResolverV2 to bypass endpoint rules entirely + // UsePathStyle is required: without it the SDK uses virtual-hosted style and + // drops the bucket name from the URL path (bucket ends up in hostname which + // the custom resolver replaces, losing it entirely). client := s3.NewFromConfig(awsCfg, func(o *s3.Options) { o.EndpointResolverV2 = &customEndpointResolver{ endpointURL: *endpointURL, } + o.UsePathStyle = true }) return &B2Client{ diff --git a/cmd/acb-worker/db.go b/cmd/acb-worker/db.go index a8639a2..be55269 100644 --- a/cmd/acb-worker/db.go +++ b/cmd/acb-worker/db.go @@ -399,9 +399,14 @@ func (c *DBClient) SubmitMatchResult(ctx context.Context, jobID string, result * log.Printf("failed to update series result for match %s: %v", matchID, err) } - // Update crash strikes and cooldown for each participant - if err := updateCrashStrikes(ctx, tx, result.CrashedBots); err != nil { - log.Printf("failed to update crash strikes for match %s: %v", matchID, err) + // Update crash strikes only for technical failures, not for normal game + // endings. In snake-style games every bot eventually "crashes" (hits a wall + // or another snake) — that is the normal end condition, not an error. + // "stalemate" and "turns" are the expected EndReason values for normal play. + if result.EndReason != "stalemate" && result.EndReason != "turns" { + if err := updateCrashStrikes(ctx, tx, result.CrashedBots); err != nil { + log.Printf("failed to update crash strikes for match %s: %v", matchID, err) + } } if err := tx.Commit(); err != nil {