mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Compare commits
No commits in common. "969b7c14bae4af828c54d306631ac22b1537e5b9" and "0b3a868640f58d0e8d13948d4a915fe479b261df" have entirely different histories.
969b7c14ba
...
0b3a868640
|
@ -174,11 +174,6 @@ class DomainManager:
|
|||
req_id, json_part)
|
||||
await connection.execute("select pg_notify('debugresponse', 'SITE END ' || $1);",
|
||||
req_id)
|
||||
else:
|
||||
await connection.execute("select pg_notify('debugresponse', 'SITE CHUNK ' || $1 || ' ' || $2);",
|
||||
req_id, json.dumps({"error": "Wiki has not been found in running cache. Please make sure you've given appropriate script URL.", "url": "https://frisk.space/imgs/cat.png"}))
|
||||
await connection.execute("select pg_notify('debugresponse', 'SITE END ' || $1);",
|
||||
req_id)
|
||||
else:
|
||||
logger.error("Unknown pub/sub command! Payload: {}".format(payload))
|
||||
|
||||
|
|
|
@ -322,7 +322,6 @@ class Wiki:
|
|||
# any([True for k in request_data.keys() if k in ("error", "errors")])
|
||||
errors: list = request_data.get("errors", {}) # Is it ugly? I don't know tbh
|
||||
if errors:
|
||||
logger.error("MediaWiki error on request: {}".format(url))
|
||||
raise MediaWikiError(str(errors))
|
||||
warnings: list = request_data.get("warnings", {})
|
||||
if warnings:
|
||||
|
@ -399,6 +398,9 @@ class Wiki:
|
|||
except ValueError:
|
||||
logger.warning("ValueError when extracting JSON data on {url}".format(url=request.url))
|
||||
raise ServerError
|
||||
except MediaWikiError:
|
||||
logger.exception("MediaWiki error on request: {}".format(request.url))
|
||||
raise
|
||||
except KeyError:
|
||||
logger.exception("KeyError while iterating over json_path, full response: {}".format(request.json()))
|
||||
raise
|
||||
|
@ -483,7 +485,7 @@ class Wiki:
|
|||
try:
|
||||
request = await self.fetch_wiki(amount=amount)
|
||||
self.client.last_request = request
|
||||
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError, WikiServerError, ServerError, MediaWikiError) as e:
|
||||
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError, WikiServerError, ServerError) as e:
|
||||
self.statistics.update(Log(type=LogType.CONNECTION_ERROR, title=str(str(e.exception) if hasattr(e, "exception") else repr(e))))
|
||||
amount_of_failures = len(self.statistics.last_connection_failures()[0])
|
||||
if amount_of_failures < 2:
|
||||
|
|
Loading…
Reference in a new issue