-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup thread tests, introduce "Slow" ExampleJob type, refactor Exam…
…pleJob types, run cron in GoodJob Development harness (#390)
- Loading branch information
1 parent
c2949e8
commit 719af5b
Showing
6 changed files
with
93 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Output Postgres notifications through Rails.logger instead of stderr | ||
if Rails.env.development? | ||
ActiveSupport.on_load :active_record do | ||
ActiveRecord::ConnectionAdapters::AbstractAdapter.set_callback :checkout, :before, lambda { |conn| | ||
raw_connection = conn.raw_connection | ||
next unless raw_connection.respond_to? :set_notice_receiver | ||
|
||
raw_connection.set_notice_receiver do |result| | ||
Rails.logger.info("Postgres notice: #{result.error_message}\n#{caller.join("\n")}") | ||
end | ||
} | ||
end | ||
end |