Commit graph

3 commits

Author SHA1 Message Date
rhymes
33a11adca8
Various optimizations (#6249) [deploy]
* Pluck over map
* Explain why map makes sense there
* Refactor reactions controller a bit and iterate only once
* Use group by instead of N counting queries
* More positive
* Simplify BufferedArticlesController
* Less queries for MailchimpBot
* Use Rails instead of SQL
* Build comment_ids only when needed
2020-02-25 13:42:24 -05:00
rhymes
87116dcc56 Increase efficiency in models/article_spec.rb (#4882) [deploy]
* Add test sampler

* Use let! and let_it_be for article_spec.rb

* Regroup and restructure expectations and tests

* Move private methods in private

* Decrease the needed objects in .seo_boostable test

* Re-use the user

* Newlined
2019-11-26 10:32:39 -05:00
Anna Buianova
875114395c Fix delayed job errors related to reactions #1621 (#1883)
* Add delayed_job_web to dev environment for debugging

* Add specs for the current Follow callbacks implementation

* Move follower touching to ActiveJob

* Spec for the touch followers job

* Move Follow#create_chat_channel to ActiveJob and make the job safe

* Add ActiveJob to send email notifications about follows

* Enqueue SendEmailNotificationJob after the follow is created

* Specs to wnsure jobs are enqueued on Follow creation

* Make CreateChatChannelJob queue name more specific

* Reaction specs for Reaction after_save callbacks logic

* Touch user job

* Call Users::TouchJob on reaction create

* Move updating reactable to a separate job

* Move busting reactable cache to a separate job

* Bust homepage cache after reaction save in a separate job

* Spec for enqueueing Users::TouchJob on reaction create

* Refactor Reactions::UpdateReactable job

* Fix observer spec
2019-02-27 16:19:01 -08:00