jeremyboles-graffic 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/graffic.rb +16 -6
  2. metadata +1 -1
data/lib/graffic.rb CHANGED
@@ -43,9 +43,14 @@ class Graffic < ActiveRecord::Base
43
43
  def handle_top_in_process_queue!
44
44
  if message = process_queue.receive
45
45
  data = YAML.load(message.to_s)
46
- return unless record = find(data[:id])
47
- record.process!
48
- message.delete
46
+ begin
47
+ record = find(data[:id])
48
+ record.process!
49
+ rescue ActiveRecord::RecordNotFound
50
+ return 'Not found'
51
+ ensure
52
+ message.delete
53
+ end
49
54
  end
50
55
  end
51
56
 
@@ -54,9 +59,14 @@ class Graffic < ActiveRecord::Base
54
59
  if message = upload_queue.receive
55
60
  data = YAML.load(message.to_s)
56
61
  return if data[:hostname] != `hostname`.strip
57
- return unless record = find(data[:id])
58
- record.upload!
59
- message.delete
62
+ begin
63
+ record = find(data[:id])
64
+ record.upload!
65
+ rescue ActiveRecord::RecordNotFound
66
+ return 'Not found'
67
+ ensure
68
+ message.delete
69
+ end
60
70
  end
61
71
  end
62
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeremyboles-graffic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Boles