Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Commit

Permalink
terminate worker actors after task is complete - fix memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
obi-a committed Jul 10, 2017
1 parent 981e992 commit ade9696
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/ragios/events/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def perform(options)
puts options.inspect
@event = JSON.parse(options, symbolize_names: true)
log_event
terminate
end

private
Expand Down
1 change: 1 addition & 0 deletions lib/ragios/monitors/workers/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def perform(monitor_id)
type: "event",
event_type: "monitor.test"
)
terminate
rescue Exception => e
log_error(e, generic_monitor)
raise e
Expand Down
4 changes: 2 additions & 2 deletions lib/ragios/notifications/notify_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def perform(event, monitor, test_result, notifier)
publisher.async.log_event!(
event_details.merge(event: occurred)
)

terminate
rescue Exception => exception
raise
occurred = {"notifier error" => exception.message}
publisher.async.log_event!(
event_details.merge(event: occurred)
)
raise exception
end

private
Expand Down

0 comments on commit ade9696

Please sign in to comment.