From f3673173b1560d839848ffbb619ae40626007ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 17 Dec 2021 13:07:04 +0100 Subject: [PATCH] manman-sync: use error codes correctly --- package/gluon-manman-sync/luasrc/usr/bin/manman-sync | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-manman-sync/luasrc/usr/bin/manman-sync b/package/gluon-manman-sync/luasrc/usr/bin/manman-sync index f028204f..d3ebb799 100755 --- a/package/gluon-manman-sync/luasrc/usr/bin/manman-sync +++ b/package/gluon-manman-sync/luasrc/usr/bin/manman-sync @@ -32,11 +32,11 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then local success, a, b, c = pcall(function() return fetch.request_raw(manapi .. '/') end) if not success then print('E: couldnt reach manman: ' .. a) - return 2 + return 1 else if a ~= 200 then print('E: couldnt reach manman - unexpected fetch result', a, b, c) - return 2 + return 1 end end @@ -51,12 +51,12 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then if code ~= 200 then print('E: got status code ' .. code) - return 2 + return 1 end if code < 1 then print('E: failed to fetch') - return 2 + return 1 end -- cloudflare's reverse proxies send http chunked responses with chunk sizes