squeese 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/examples/enqueue.rb CHANGED
@@ -1,6 +1,9 @@
1
+ #!/usr/bin/ruby
2
+
1
3
  $LOAD_PATH.unshift '../lib'
2
4
  require 'squeese'
3
5
 
4
6
  Squeese.queue_name = "example"
5
7
  Squeese.enqueue('send.email', :email => 'hello@example.com')
6
8
  Squeese.enqueue('cleanup.strays')
9
+ Squeese.enqueue('error')
data/examples/jobs.rb CHANGED
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/ruby
2
+
1
3
  $LOAD_PATH.unshift '../lib'
2
4
  require 'squeese'
3
5
 
@@ -16,3 +18,9 @@ end
16
18
  job 'cleanup.strays' do |args|
17
19
  log "Cleaning up"
18
20
  end
21
+
22
+ job 'error' do |args|
23
+ log "Throwing an Error"
24
+ throw RuntimeError
25
+ end
26
+
data/lib/squeese.rb CHANGED
@@ -57,7 +57,9 @@ module Squeese
57
57
  handler.call(args)
58
58
  msg.delete
59
59
  rescue => e
60
+ log "Deleting failed job." if msg
60
61
  log exception_message(e)
62
+ msg.delete if msg
61
63
  end
62
64
 
63
65
  def log_job(name, args)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter van Hardenberg
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-04 00:00:00 -07:00
17
+ date: 2010-06-14 00:00:00 -07:00
18
18
  default_executable: squeese
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency