Avoid vthread pinning on invitations

This commit is contained in:
Andrey Antukh 2023-03-18 18:44:57 +01:00
parent 4e7f32aa88
commit e30d1a40bc

View file

@ -764,15 +764,17 @@
:hint "looks like the profile has reported repeatedly as spam or has permanent bounces")) :hint "looks like the profile has reported repeatedly as spam or has permanent bounces"))
(let [cfg (assoc cfg ::db/conn conn) (let [cfg (assoc cfg ::db/conn conn)
invitations (->> emails invitations (into []
(remove member?) (comp
(map (fn [email] (remove member?)
{:email (str/lower email) (map (fn [email]
:team team {:email (str/lower email)
:profile profile :team team
:role role})) :profile profile
(keep (partial create-invitation cfg)))] :role role}))
(with-meta (vec invitations) (keep (partial create-invitation cfg)))
emails)]
(with-meta invitations
{::audit/props {:invitations (count invitations)}}))))) {::audit/props {:invitations (count invitations)}})))))