Fix federation self test
This commit is contained in:
@@ -74,6 +74,9 @@ async def handle_logging(response):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if request.path.startswith("/.well-known/matrix/"):
|
||||||
|
return response
|
||||||
|
|
||||||
print(
|
print(
|
||||||
f"[{origin}] " +
|
f"[{origin}] " +
|
||||||
f'[{datetime.now().strftime("%d/%b/%Y:%H:%M:%S")}] ' +
|
f'[{datetime.now().strftime("%d/%b/%Y:%H:%M:%S")}] ' +
|
||||||
@@ -137,7 +140,10 @@ def federation_self_test():
|
|||||||
destination=config.server_name,
|
destination=config.server_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
resp.raise_for_status()
|
if str(resp.status_code).startswith("5") or str(resp.status_code).startswith("4"):
|
||||||
|
print(f"[FATL] Federation self-test failed: status code is not acceptable ({str(resp.status_code)})")
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
print("[INFO] Federation self-test OK")
|
print("[INFO] Federation self-test OK")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[FATL] Federation self-test failed: {e}")
|
print(f"[FATL] Federation self-test failed: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user