This file contains 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
# rails g model Book name:string:index description:text ‘cost:decimal{5,2}’ | |
class CreateBooks < ActiveRecord::Migration | |
def change | |
create_table :books do |t| | |
t.string :name | |
t.text :description | |
t.decimal :cost, precision: 5, scale: 2 | |
t.timestamps | |
end |
This file contains 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
# rails g model Book name:string:index isbn:string:uniq description:text user:references content:string{30} | |
class CreateBooks < ActiveRecord::Migration | |
def change | |
create_table :books do |t| | |
t.string :name | |
t.string :isbn | |
t.text :description | |
t.references :user, index: true | |
t.string :content, limit: 30 |
This file contains 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
# /etc/init/sidekiq.conf - Sidekiq config | |
# This example config should work with Ubuntu 12.04+. It | |
# allows you to manage multiple Sidekiq instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# See workers.conf for how to manage all Sidekiq instances at once. | |
# | |
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with: | |
# sudo start sidekiq index=0 |
This file contains 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
# /etc/init/workers.conf - manage a set of Sidekiqs | |
# This example config should work with Ubuntu 12.04+. It | |
# allows you to manage multiple Sidekiq instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# See sidekiq.conf for how to manage a single Sidekiq instance. | |
# | |
# Use "stop workers" to stop all Sidekiq instances. | |
# Use "start workers" to start all instances. |
This file contains 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 Rails.env.production? | |
Sidekiq.configure_server do |config| | |
config.redis = { :url => 'redis://10.0.WX.YZ:6379/12', :namespace => 'sidekiq' } | |
end | |
Sidekiq.configure_client do |config| | |
config.redis = { :url => 'redis://10.0.WX.YZ:6379/12', :namespace => 'sidekiq' } | |
end | |
end |
This file contains 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
require 'vlad/sidekiq' | |
task "vlad:deploy" => %w[ | |
vlad:update | |
vlad:bundle:install | |
vlad:migrate | |
vlad:assets:precompile | |
vlad:sidekiq:restart | |
vlad:start_app | |
vlad:cleanup |
This file contains 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
lib/tasks/act_celluloid.rake | |
namespace :act_celluloid do | |
task :crawl => :environment do | |
app_ids = get_items | |
supervisor = Celluloid::SupervisionGroup.run! | |
supervisor.pool(AppActor, as: :app_actors, size: 10) | |
futures = [] |
NewerOlder