Skip to content

Commit

Permalink
Merge pull request #351 from NobodysNightmare/NobodysNightmare-patch-1
Browse files Browse the repository at this point in the history
Fix rendering of 503 error when lock is still held
  • Loading branch information
sonots authored May 29, 2021
2 parents 01d7456 + 6e0610a commit 9dffd92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/geminabox/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def file_class=(klass)
def serialize_update(&block)
with_rlock(&block)
rescue ReentrantFlock::AlreadyLocked
halt 503, { 'Retry-After' => Geminabox.retry_interval }, 'Repository lock is held by another process'
halt 503, { 'Retry-After' => Geminabox.retry_interval.to_s }, 'Repository lock is held by another process'
end

def with_rlock(&block)
Expand Down
2 changes: 1 addition & 1 deletion test/units/geminabox/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def @server.halt(code, headers, message)
@server.send(:serialize_update){}
expected_args = [
503,
{'Retry-After' => Geminabox.retry_interval},
{ 'Retry-After' => Geminabox.retry_interval.to_s },
'Repository lock is held by another process'
]
assert_equal expected_args, @server.args
Expand Down

0 comments on commit 9dffd92

Please sign in to comment.