Make file schema validation configurable using flags

This commit is contained in:
Andrey Antukh 2023-11-20 19:27:54 +01:00
parent 0081db4770
commit ac3d7f00d5
6 changed files with 43 additions and 12 deletions

View file

@ -151,7 +151,9 @@
(ps/acquire! feat/*semaphore*)
(px/submit! scope (fn []
(-> (assoc system ::db/rollback rollback?)
(feat/migrate-file! file-id :validate? validate?)))))
(feat/migrate-file! file-id
:validate? validate?
:throw-on-validate? (not skip-on-error))))))
(get-candidates))
(p/await! scope))
@ -182,7 +184,9 @@
(binding [feat/*stats* stats
feat/*skip-on-error* skip-on-error]
(-> (assoc system ::db/rollback rollback?)
(feat/migrate-team! team-id :validate? validate?))
(feat/migrate-team! team-id
:validate? validate?
:throw-on-validate? (not skip-on-error)))
(print-stats!
(-> (deref feat/*stats*)
@ -238,7 +242,9 @@
(migrate-team [team-id]
(try
(-> (assoc system ::db/rollback rollback?)
(feat/migrate-team! team-id :validate? validate? :throw-on-validate? (not skip-on-error)))
(feat/migrate-team! team-id
:validate? validate?
:throw-on-validate? (not skip-on-error)))
(catch Throwable cause
(l/err :hint "unexpected error on processing team" :team-id (dm/str team-id) :cause cause))))