Skip to content

Commit 7a92fc1

Browse files
brandonchinn178ysangkok
authored andcommitted
Move + rename genEmails => genDependencyUpdateList
1 parent 0f21fe9 commit 7a92fc1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Distribution/Server/Features/UserNotify.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,8 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
698698

699699
idx <- queryGetPackageIndex
700700
revIdx <- liftIO queryReverseIndex
701-
let
702-
genEmails :: PackageIdentifier -> IO (Map.Map (UserId, PackageId) [PackageId])
703-
genEmails =
704-
dependencyReleaseEmails (queryUserGroup . maintainersGroup) idx revIdx queryGetUserNotifyPref
705-
dependencyEmailMap <- Map.unionsWith (++) <$> traverse (genEmails . pkgInfoToPkgId) revisionsAndUploads
706-
dependencyEmails <- Map.mapKeys fst <$> Map.traverseWithKey describeDependencyUpdate dependencyEmailMap
701+
dependencyUpdateNotifications <- Map.unionsWith (++) <$> traverse (genDependencyUpdateList idx revIdx . pkgInfoToPkgId) revisionsAndUploads
702+
dependencyEmails <- Map.mapKeys fst <$> Map.traverseWithKey describeDependencyUpdate dependencyUpdateNotifications
707703

708704
-- Concat the constituent email parts such that only one email is sent per user
709705
mapM_ (sendNotifyEmailAndDelay users) . Map.toList $ foldr1 (Map.unionWith (++)) $ [revisionUploadEmails, groupActionEmails, docReportEmails, tagProposalEmails]
@@ -799,6 +795,9 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
799795
maintainers <- queryUserGroup $ maintainersGroup (fst pkgTags)
800796
return $ foldr addNotification mp (toList maintainers)
801797

798+
genDependencyUpdateList idx revIdx =
799+
dependencyReleaseEmails (queryUserGroup . maintainersGroup) idx revIdx queryGetUserNotifyPref
800+
802801
describeRevision users earlier now pkg =
803802
if pkgNumRevisions pkg <= 1
804803
then "Package upload, " ++ display (packageName pkg) ++ ", by " ++

0 commit comments

Comments
 (0)