docbrown/app/workers/users
Jeremy Friesen 3a08716ad3
Reducing subtle duplication of effort/logic (#17078)
Prior to this commit, when we change attributes for a user we might
resave each article.  The purpose of the resave is to update some of the
cached attributes of an article.

This removes some redundant code.  The following removed code has
an `article.save` call.  Which, the callbacks in the article (see below)
already clear the cache.

```ruby
def resave_articles
  articles.find_each do |article|
    if article.path
      cache_bust = EdgeCache::Bust.new
      cache_bust.call(article.path)
      cache_bust.call("#{article.path}?i=i")
    end
    article.save
  end
end
```

8e6981aac5/app/models/article.rb (L164)

8e6981aac5/app/models/article.rb (L881-L888)

This was discovered in triaging forem/forem#17041
2022-04-01 13:32:44 -04:00
..
bust_cache_worker.rb Cleanup bust_user (#12066) 2020-12-30 10:07:42 -05:00
delete_worker.rb Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
follow_worker.rb Bug Fix: Prevent Duplicate Follow Attempts by Preventing Multiple Workers (#9169) 2020-07-06 16:15:39 -04:00
merge_sync_worker.rb Rubocop: enable and fix new Rails cops (#9537) 2020-07-29 11:14:19 +02:00
record_field_test_event_worker.rb Fix goal conversion field test typo (#15985) 2022-01-06 16:34:36 -05:00
resave_articles_worker.rb Reducing subtle duplication of effort/logic (#17078) 2022-04-01 13:32:44 -04:00
subscribe_to_mailchimp_newsletter_worker.rb Don't try to subscribe users without emails (#14244) 2021-07-15 10:34:23 -04:00