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
module Resque | |
# Raised when a worker was killed while processing a job. | |
class DirtyExit < RuntimeError; end | |
class Worker | |
module KillPatch | |
module InstanceMethods | |
def unregister_worker_with_error_job(*args) | |
if self.job |
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 'sinatra/base' | |
class ResqueWeb < Sinatra::Base | |
require 'resque/server' | |
use Rack::ShowExceptions | |
# Set the AUTH env variable to your basic auth password to protect Resque. | |
AUTH_PASSWORD = ENV['AUTH'] | |
if AUTH_PASSWORD | |
Resque::Server.use Rack::Auth::Basic do |username, password| |
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
source "http://gemcutter.org" | |
gem "rails", "2.3.5" | |
gem 'mysql', '2.8.1' | |
gem "erubis", "2.6.5" | |
gem "rack"#, '1.0.1' | |
gem "resque", '1.5.0' | |
gem 'redis', '0.1.2' |
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
#!/sbin/runscript | |
# | |
# Mongo init script for Gentoo | |
# | |
opts="start stop restart" | |
depend() { | |
use net | |
} |
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
c = MongoMapper.database.collection('system.js') | |
c.save(:_id => 'sdc_test', :value => Mongo::Code.new("function(x, y){ print('within method'); return x + y + 2}")) | |
MongoMapper.database.eval(Mongo::Code.new('sdc_test(x,y)', :x => 3, :y => 2)) | |
# should see 'witin method' in /var/log/mongodb/output.log |
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
$ vm_stat | |
Mach Virtual Memory Statistics: (page size of 4096 bytes) | |
Pages free: 70104. | |
Pages active: 451608. | |
Pages inactive: 146907. | |
Pages speculative: 25993. | |
Pages wired down: 91606. | |
"Translation faults": 335008193. | |
Pages copy-on-write: 18718373. | |
Pages zero filled: 144137680. |
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
Adam$ script/console | |
Loading development environment (Rails 2.3.4) | |
>> Mongo::VERSION | |
=> "0.15.1" | |
>> #MongoMapper::VERSION == 0.5.5 | |
?> document = Class.new do | |
?> include MongoMapper::Document | |
>> set_collection_name 'duplicate_id_test' | |
>> | |
?> key :data, String |
NewerOlder