Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/1.9.3' into develop
- Loading branch information
Showing
4 changed files
with
44 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class Search | ||
MAX_ATTEMPTS = 5 | ||
|
||
# this should help with the "index not prerea"d errors | ||
# the error happens when somebody searches the moment that sphinx is rotating | ||
# the indexes, which happens very quickly. This gives it a chance to finish | ||
# and still return results instead of a 500 error - see https://gist.github.com/1818244 | ||
def self.with_retries | ||
attempt = 0 | ||
begin | ||
yield | ||
rescue ThinkingSphinx::SphinxError | ||
# We over-eagerly rescue all Sphinx errors. But since we re-raise them | ||
# if they still fail after a few attempts, we don't hide anything. | ||
attempt += 1 | ||
if attempt > MAX_ATTEMPTS | ||
raise | ||
else | ||
retry | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Donortrust | ||
unless defined?(Donortrust::VERSION) | ||
VERSION = '1.9.2' | ||
VERSION = '1.9.3' | ||
end | ||
end |