Skip to content

Commit

Permalink
Merge pull request #637 from indirect/cloudflare-error-debugging
Browse files Browse the repository at this point in the history
try for clearer backtrace next error
  • Loading branch information
indirect authored Feb 21, 2025
2 parents 0a1f532 + 49ab761 commit 2667b53
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/mailboxes/post_mailbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,16 @@ def feed_url(*, **)
def purge_cache(feed)
return unless Rails.application.config.cloudflare_api_token

urls = [feed_url(feed), feed_url(feed, format: :atom), feed_url(feed, format: :json)]
urls = [
feed_url(feed),
feed_url(feed, format: :atom),
feed_url(feed, format: :json)
]

Cloudflare.connect(token: Rails.application.config.cloudflare_api_token) do |c|
c.zones.find_by_name("feedyour.email").purge_cache(files: urls) # rubocop:disable Rails/DynamicFindBy
zones = c.zones
zone = zones.find_by_name("feedyour.email") # rubocop:disable Rails/DynamicFindBy
zone.purge_cache(files: urls)
end
end
end

0 comments on commit 2667b53

Please sign in to comment.