💄 Format backend code

This commit is contained in:
Andrey Antukh 2024-01-05 13:42:00 +01:00 committed by Alonso Torres
parent cfe7ba34f7
commit 0b29aaecc4
11 changed files with 43 additions and 54 deletions

View file

@ -201,9 +201,9 @@
;; because of the timestamp precission (two concurrent requests), in
;; this case we just retry the operation.
(let [cfg (-> cfg
(assoc ::rtry/when rtry/conflict-exception?)
(assoc ::rtry/max-retries 6)
(assoc ::rtry/label "persist-audit-log"))
(assoc ::rtry/when rtry/conflict-exception?)
(assoc ::rtry/max-retries 6)
(assoc ::rtry/label "persist-audit-log"))
params (-> params
(update :props db/tjson)
(update :context db/tjson)

View file

@ -816,16 +816,16 @@
(update :features #(db/create-array conn "text" %))
(update :data blob/encode))]
(l/dbg :hint "create file" :id (str file-id') ::l/sync? true)
(l/dbg :hint "create file" :id (str file-id') ::l/sync? true)
(if overwrite?
(create-or-update-file! conn file)
(db/insert! conn :file file))
(if overwrite?
(create-or-update-file! conn file)
(db/insert! conn :file file))
(when overwrite?
(db/delete! conn :file-thumbnail {:file-id file-id'}))
(when overwrite?
(db/delete! conn :file-thumbnail {:file-id file-id'}))
file-id'))))
file-id'))))
(defmethod read-section :v1/rels
[{:keys [::db/conn ::input ::timestamp]}]
@ -1008,8 +1008,8 @@
(if (:image v)
(update-in res [k :image :id] lookup-index)
res))
colors
colors))
colors
colors))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; HIGH LEVEL API

View file

@ -312,7 +312,7 @@
(teams/check-read-permissions! conn profile-id team-id))
(let [projs (db/query conn :project
{:team-id team-id})
{:team-id team-id})
files (let [sql (str "SELECT f.id "
" FROM file AS f "

View file

@ -157,7 +157,7 @@
:or {rollback? true
skip-on-error true
validate? false
max-procs 1 }
max-procs 1}
:as opts}]
(l/dbg :hint "migrate:start" :rollback rollback?)
@ -256,20 +256,20 @@
:else
(px/submit! scope (fn []
(try
(mark-team-migration! system id)
(-> (assoc system ::db/rollback rollback?)
(feat/migrate-team! id
:max-procs max-procs
:validate? validate?
:throw-on-validate? (not skip-on-error)))
(catch Throwable cause
(l/err :hint "unexpected error on processing team"
:team-id (str id)
:cause cause))
(finally
(ps/release! sjobs)
(unmark-team-migration! system id))))))))]
(try
(mark-team-migration! system id)
(-> (assoc system ::db/rollback rollback?)
(feat/migrate-team! id
:max-procs max-procs
:validate? validate?
:throw-on-validate? (not skip-on-error)))
(catch Throwable cause
(l/err :hint "unexpected error on processing team"
:team-id (str id)
:cause cause))
(finally
(ps/release! sjobs)
(unmark-team-migration! system id))))))))]
(l/dbg :hint "migrate:start"
:rollback rollback?

View file

@ -113,13 +113,13 @@
(fn [params]
(let [min-age (dt/duration (or (:min-age params) min-age))]
(db/tx-run! cfg (fn [cfg]
(let [cfg (assoc cfg ::min-age min-age)
total (clean-deleted! cfg)]
(let [cfg (assoc cfg ::min-age min-age)
total (clean-deleted! cfg)]
(l/inf :hint "task finished"
:min-age (dt/format-duration min-age)
:total total)
(l/inf :hint "task finished"
:min-age (dt/format-duration min-age)
:total total)
{:deleted total}))))))
{:deleted total}))))))