karait 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/karait.gemspec +2 -2
- data/lib/message.rb +2 -1
- data/lib/queue.rb +2 -4
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/karait.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{karait}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["bcoe"]
|
12
|
-
s.date = %q{2011-09-
|
12
|
+
s.date = %q{2011-09-02}
|
13
13
|
s.description = %q{A ridiculously simple cross-language queuing system, built on top of MongoDB.}
|
14
14
|
s.email = %q{bencoe@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/message.rb
CHANGED
@@ -56,10 +56,11 @@ module Karait
|
|
56
56
|
current_time = Time.now().to_f
|
57
57
|
meta = @source.fetch('_meta', {})
|
58
58
|
|
59
|
-
return if meta.fetch('expire', -1.0)
|
59
|
+
return if meta.fetch('expire', -1.0) <= -1.0
|
60
60
|
|
61
61
|
if current_time - meta.fetch('timestamp', 0.0) > meta.fetch('expire', -1.0)
|
62
62
|
@expired = true
|
63
|
+
delete
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
data/lib/queue.rb
CHANGED
@@ -57,7 +57,7 @@ module Karait
|
|
57
57
|
end
|
58
58
|
|
59
59
|
update = false
|
60
|
-
if opts[:visibility_timeout]
|
60
|
+
if opts[:visibility_timeout] > -1.0
|
61
61
|
update = {
|
62
62
|
'$set' => {
|
63
63
|
'_meta.visible_after' => current_time + opts[:visibility_timeout]
|
@@ -94,9 +94,7 @@ module Karait
|
|
94
94
|
|
95
95
|
raw_messages.each do |raw_message|
|
96
96
|
message = Karait::Message.new(raw_message=raw_message, queue_collection=@queue_collection)
|
97
|
-
if message.expired?
|
98
|
-
message.delete()
|
99
|
-
else
|
97
|
+
if not message.expired?
|
100
98
|
messages << message
|
101
99
|
end
|
102
100
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karait
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- bcoe
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-02 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|