fix(abi): do not error on the nothing-to-repair path (#208)
Some checks are pending
ci/crow/cron/process-updates/17 Pipeline was successful
ci/crow/manual/reindex/8 Pipeline is pending
ci/crow/manual/reindex/7 Pipeline was successful
ci/crow/manual/backfill-flat-safety/7 Pipeline was successful
ci/crow/cron/process-updates/12 Pipeline was successful
ci/crow/cron/process-updates/5 Pipeline was successful
ci/crow/cron/process-updates/6 Pipeline was successful
ci/crow/manual/backfill-flat-safety/8 Pipeline was successful
Some checks are pending
ci/crow/cron/process-updates/17 Pipeline was successful
ci/crow/manual/reindex/8 Pipeline is pending
ci/crow/manual/reindex/7 Pipeline was successful
ci/crow/manual/backfill-flat-safety/7 Pipeline was successful
ci/crow/cron/process-updates/12 Pipeline was successful
ci/crow/cron/process-updates/5 Pipeline was successful
ci/crow/cron/process-updates/6 Pipeline was successful
ci/crow/manual/backfill-flat-safety/8 Pipeline was successful
## Why
Pipeline 12480 shows this for slots with nothing to do:
```
Error in sprintf("%s/%s: %d objects recorded, none unsafe. Nothing to repair.", :
```
`RPostgres` returns `count(*)` as `integer64`, and `%d` rejects it. So a slot in the **best possible state** — verdicts recorded, nothing unsafe — failed its pipeline step, while slots with real work to do succeeded. Exactly the wrong signal.
## What changed
Formats the count as a string. One line, plus a comment recording why `%d` is wrong here.
Reviewed-on: #208
This commit is contained in:
parent
e3b7212eaf
commit
4342fa773a
1 changed files with 4 additions and 2 deletions
|
|
@ -141,11 +141,13 @@ if (nrow(rows) == 0L) {
|
||||||
call. = FALSE
|
call. = FALSE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
# `count(*)` arrives as a double (or integer64), and `%d` rejects both, so the
|
||||||
|
# nothing-to-do path used to die on its own success message.
|
||||||
message(sprintf(
|
message(sprintf(
|
||||||
"%s/%s: %d objects recorded, none unsafe. Nothing to repair.",
|
"%s/%s: %s objects recorded, none unsafe. Nothing to repair.",
|
||||||
arch,
|
arch,
|
||||||
codename,
|
codename,
|
||||||
total
|
format(as.numeric(total), scientific = FALSE)
|
||||||
))
|
))
|
||||||
quit(status = 0)
|
quit(status = 0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue