sad 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -0
- data/VERSION +1 -1
- data/lib/sad/server.rb +5 -3
- data/sad.gemspec +2 -1
- data/test/test_redis.rb +9 -0
- metadata +3 -2
    
        data/README.md
    CHANGED
    
    | @@ -141,6 +141,10 @@ level的取值如下: | |
| 141 141 | 
             
            * FATAL = 4
         | 
| 142 142 | 
             
            * UNKNOWN = 5
         | 
| 143 143 |  | 
| 144 | 
            +
            ## 注意事项
         | 
| 145 | 
            +
             | 
| 146 | 
            +
            * 本库使用的redis是em-hiredis,和redis库冲突,同一个项目不能同时引用
         | 
| 147 | 
            +
             | 
| 144 148 | 
             
            ## Contributing to sad
         | 
| 145 149 |  | 
| 146 150 | 
             
            * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.5. | 
| 1 | 
            +
            1.5.3
         | 
    
        data/lib/sad/server.rb
    CHANGED
    
    | @@ -8,17 +8,19 @@ module Sad | |
| 8 8 | 
             
            			end
         | 
| 9 9 |  | 
| 10 10 | 
             
            			def fetch(queue)
         | 
| 11 | 
            -
            				 | 
| 11 | 
            +
            				::Sad::Procline.set("Wainting for #{queue}")
         | 
| 12 | 
            +
            				request = ::Sad::Config.redis.blpop(queue, 30)
         | 
| 12 13 | 
             
            				request.callback{|_, data|
         | 
| 14 | 
            +
            					::Sad::Procline.set("Fetched #{queue} - #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}")
         | 
| 13 15 | 
             
            					if data
         | 
| 14 | 
            -
            						logger.info '-'*15 + data.inspect + '-'*15
         | 
| 16 | 
            +
            						::Sad.logger.info '-'*15 + data.inspect + '-'*15
         | 
| 15 17 | 
             
            						payload = Payload.decode(data)
         | 
| 16 18 | 
             
            						payload_call(payload)
         | 
| 17 19 | 
             
            					end
         | 
| 18 20 | 
             
            					fetch_with_interval(queue)
         | 
| 19 21 | 
             
            				}
         | 
| 20 22 | 
             
            				request.errback{
         | 
| 21 | 
            -
            					logger.error "error with redis request.\n#{request.inspect}"
         | 
| 23 | 
            +
            					::Sad.logger.error "error with redis request.\n#{request.inspect}"
         | 
| 22 24 | 
             
            					fetch_with_interval(queue)
         | 
| 23 25 | 
             
            				}
         | 
| 24 26 | 
             
            			end
         | 
    
        data/sad.gemspec
    CHANGED
    
    | @@ -5,7 +5,7 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = "sad"
         | 
| 8 | 
            -
              s.version = "1.5. | 
| 8 | 
            +
              s.version = "1.5.3"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["\u{5d14}\u{5ce5}"]
         | 
| @@ -38,6 +38,7 @@ Gem::Specification.new do |s| | |
| 38 38 | 
             
                "test/helper.rb",
         | 
| 39 39 | 
             
                "test/test_logger.rb",
         | 
| 40 40 | 
             
                "test/test_perform_with_exception.rb",
         | 
| 41 | 
            +
                "test/test_redis.rb",
         | 
| 41 42 | 
             
                "test/test_sad.rb"
         | 
| 42 43 | 
             
              ]
         | 
| 43 44 | 
             
              s.homepage = "http://github.com/charlescui/sad"
         | 
    
        data/test/test_redis.rb
    ADDED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sad
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.5. | 
| 4 | 
            +
              version: 1.5.3
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -168,6 +168,7 @@ files: | |
| 168 168 | 
             
            - test/helper.rb
         | 
| 169 169 | 
             
            - test/test_logger.rb
         | 
| 170 170 | 
             
            - test/test_perform_with_exception.rb
         | 
| 171 | 
            +
            - test/test_redis.rb
         | 
| 171 172 | 
             
            - test/test_sad.rb
         | 
| 172 173 | 
             
            homepage: http://github.com/charlescui/sad
         | 
| 173 174 | 
             
            licenses:
         | 
| @@ -184,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 184 185 | 
             
                  version: '0'
         | 
| 185 186 | 
             
                  segments:
         | 
| 186 187 | 
             
                  - 0
         | 
| 187 | 
            -
                  hash:  | 
| 188 | 
            +
                  hash: -4609138362765043462
         | 
| 188 189 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 189 190 | 
             
              none: false
         | 
| 190 191 | 
             
              requirements:
         |