Mailinglist Archive: opensuse-buildservice (170 mails)

< Previous Next >
Re: [opensuse-buildservice] lost sync with server
On Friday 16 March 2012 00:10:20 Denis Pynkin wrote:

- in case if I connect instances to each other, I see endlessly repeated
loop in slave OBS instance scheduler log:
lost sync with server, was at N
next: N

found the reason:

[PATCH] Fixed POST /lastevents looped request.


Signed-off-by: Denis Pynkin <denis_pynkin@xxxxxxxx>
---
src/api/app/controllers/public_controller.rb | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/api/app/controllers/public_controller.rb
b/src/api/app/controllers/public_controller.rb
index eb73f46..eb63134 100644
--- a/src/api/app/controllers/public_controller.rb
+++ b/src/api/app/controllers/public_controller.rb
@@ -118,10 +118,14 @@ class PublicController < ApplicationController
# GET /public/lastevents
def lastevents
valid_http_methods :get, :post # OBS 2.3 switched to POST
-
+
path = unshift_public(request.path)
- path += "?#{request.query_string}" unless request.query_string.empty?
- pass_to_backend path
+ if request.get?
+ path += "?#{request.query_string}" unless request.query_string.empty?
+ pass_to_backend path
+ elsif request.post?
+ pass_to_backend
+ end
end

# GET /public/distributions
--
1.7.9.4


--
Best Regards,
Denis Pynkin
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References