Fix incompatibility with 32-bit platforms

This commit is contained in:
Sybren A. Stüvel 2023-05-24 21:22:36 +02:00
parent 0a2d7d3361
commit afde952c10

View File

@ -600,9 +600,9 @@ func (db *DB) AddWorkerToTaskFailedList(ctx context.Context, t *Task, w *Worker)
// Integer literals are of type `int`, so that's just a bit nicer to work with
// than `int64`.
if numFailed64 > math.MaxUint32 {
if numFailed64 > math.MaxInt32 {
log.Warn().Int64("numFailed", numFailed64).Msg("number of failed workers is crazy high, something is wrong here")
return math.MaxUint32, tx.Error
return math.MaxInt32, tx.Error
}
return int(numFailed64), tx.Error
}