This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "hanshauge.id" is my Blockstack ID. https://onename.com/hanshauge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "hanshauge.id" is my Blockstack ID. https://onename.com/hanshauge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use a different cache store in production. | |
# /config/environments/production.rb | |
config.cache_store = :dalli_store, | |
(ENV["MEMCACHIER_SERVERS"] || "").split(","), | |
{:username => ENV["MEMCACHIER_USERNAME"], | |
:password => ENV["MEMCACHIER_PASSWORD"], | |
:failover => true, | |
:socket_timeout => 1.5, | |
:socket_failure_delay => 0.2 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /config/environments/development.rb | |
config.action_controller.perform_caching = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your controller | |
time_range = (DateTime.now - 1.day)..DateTime.now | |
@listings = Rails.cache.fetch('front-page', expires_in: 1.hour) do | |
Listing.where(created_at: time_range) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you have a very small app you may be able to | |
# increase this, but in general 3 workers seems to | |
# work best | |
worker_processes 3 | |
# Load your app into the master before forking | |
# workers for super-fast worker spawn times | |
preload_app true | |
# Immediately restart any workers that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :update_rss_feeds do | |
desc "Updates all the feeds" | |
task update_all: :environment do | |
UpdateRssFeedsJob.perform_now | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdateRssFeedsJob < ActiveJob::Base | |
attr_accessor :r_jokes_feed | |
queue_as :default | |
def perform | |
update_r_jokes | |
end | |
def update_r_jokes |