mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Added more debug to statisics, changed behavior of error handling for wikis, updated error handling, more fail-safes for IRC connection
This commit is contained in:
parent
0b25f6af2c
commit
21336a8a49
|
@ -103,7 +103,7 @@ class DiscussionsFromHellParser:
|
||||||
for mark in marks:
|
for mark in marks:
|
||||||
if mark["type"] == "mention":
|
if mark["type"] == "mention":
|
||||||
prefix += "["
|
prefix += "["
|
||||||
suffix = "]({wiki}f/u/{userid}){suffix}".format(wiki=self.ctx.settings["fandom_discussions"]["wiki_url"],
|
suffix = "]({wiki}f/u/{userid}){suffix}".format(wiki=self.ctx.settings.WIKI_SCRIPT_PATH,
|
||||||
userid=mark["attrs"]["userId"], suffix=suffix)
|
userid=mark["attrs"]["userId"], suffix=suffix)
|
||||||
elif mark["type"] == "strong":
|
elif mark["type"] == "strong":
|
||||||
prefix += "**"
|
prefix += "**"
|
||||||
|
|
Binary file not shown.
|
@ -2,7 +2,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-08-03 13:44+0000\n"
|
"PO-Revision-Date: 2020-08-03 13:44+0000\n"
|
||||||
"Last-Translator: MarkusRost <>\n"
|
"Last-Translator: MarkusRost <>\n"
|
||||||
"Language-Team: German <https://weblate.frisk.space/projects/rcgcdw/main/de/"
|
"Language-Team: German <https://weblate.frisk.space/projects/rcgcdw/main/de/"
|
||||||
|
@ -17,70 +17,69 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
"X-Loco-Parser: loco_parse_po\n"
|
"X-Loco-Parser: loco_parse_po\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "Wohnort"
|
msgstr "Wohnort"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "„Über mich“-Abschnitt"
|
msgstr "„Über mich“-Abschnitt"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Google-Link"
|
msgstr "Google-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Facebook-Link"
|
msgstr "Facebook-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Twitter-Link"
|
msgstr "Twitter-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Reddit-Link"
|
msgstr "Reddit-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Twitch-Link"
|
msgstr "Twitch-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "PSN-Link"
|
msgstr "PSN-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "VK-Link"
|
msgstr "VK-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "Xbox-Live-Link"
|
msgstr "Xbox-Live-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Steam-Link"
|
msgstr "Steam-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "Discord-Link"
|
msgstr "Discord-Link"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Battle.net-Link"
|
msgstr "Battle.net-Link"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__Und mehr__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Unbekannt"
|
msgstr "Unbekannt"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "unbekannt"
|
msgstr "unbekannt"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__Und mehr__"
|
||||||
|
|
Binary file not shown.
|
@ -7,11 +7,11 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: RcGcDw\n"
|
"Project-Id-Version: RcGcDw\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2022-09-09 06:48+0000\n"
|
"PO-Revision-Date: 2022-09-09 06:48+0000\n"
|
||||||
"Last-Translator: Saurmandal <saurmandal@protonmail.com>\n"
|
"Last-Translator: Saurmandal <saurmandal@protonmail.com>\n"
|
||||||
"Language-Team: Hindi <https://translate.wikibot.de/projects/rcgcdw/misc/hi/>"
|
"Language-Team: Hindi <https://translate.wikibot.de/projects/rcgcdw/misc/hi/"
|
||||||
"\n"
|
">\n"
|
||||||
"Language: hi\n"
|
"Language: hi\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||||
"X-Generator: Weblate 4.12.1\n"
|
"X-Generator: Weblate 4.12.1\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "स्थान"
|
msgstr "स्थान"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "मेरे बारे में"
|
msgstr "मेरे बारे में"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Google कड़ी"
|
msgstr "Google कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Facebook कड़ी"
|
msgstr "Facebook कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Twitter कड़ी"
|
msgstr "Twitter कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Reddit कड़ी"
|
msgstr "Reddit कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Twitch कड़ी"
|
msgstr "Twitch कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "PSN कड़ी"
|
msgstr "PSN कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "VK कड़ी"
|
msgstr "VK कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "XBL कड़ी"
|
msgstr "XBL कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Steam कड़ी"
|
msgstr "Steam कड़ी"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "डिस्कॉर्ड खाता"
|
msgstr "डिस्कॉर्ड खाता"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Battle.net खाता"
|
msgstr "Battle.net खाता"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"और कई सारे"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "अज्ञात"
|
msgstr "अज्ञात"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "अनजान"
|
msgstr "अनजान"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "और कई सारे"
|
||||||
|
|
Binary file not shown.
|
@ -6,7 +6,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: RcGcDw\n"
|
"Project-Id-Version: RcGcDw\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-03-17 20:57+0100\n"
|
"PO-Revision-Date: 2020-03-17 20:57+0100\n"
|
||||||
"Last-Translator: Frisk <>\n"
|
"Last-Translator: Frisk <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
|
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
|
||||||
"|| n%100>=20) ? 1 : 2);\n"
|
"|| n%100>=20) ? 1 : 2);\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "Lokacja"
|
msgstr "Lokacja"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "O mnie"
|
msgstr "O mnie"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "link Google"
|
msgstr "link Google"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "link Facebook"
|
msgstr "link Facebook"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "link Twitter"
|
msgstr "link Twitter"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "link Reddit"
|
msgstr "link Reddit"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "link Twitch"
|
msgstr "link Twitch"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "link PSN"
|
msgstr "link PSN"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "link VK"
|
msgstr "link VK"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "link XBL"
|
msgstr "link XBL"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "link Steam"
|
msgstr "link Steam"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "konto Discord"
|
msgstr "konto Discord"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "konto Battle.net"
|
msgstr "konto Battle.net"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__Oraz więcej__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Nieznana"
|
msgstr "Nieznana"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "nieznana sekcja"
|
msgstr "nieznana sekcja"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__Oraz więcej__"
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-11-27 13:07+0000\n"
|
"PO-Revision-Date: 2020-11-27 13:07+0000\n"
|
||||||
"Last-Translator: dr03ramos <dr03ramos@gmail.com>\n"
|
"Last-Translator: dr03ramos <dr03ramos@gmail.com>\n"
|
||||||
"Language-Team: Portuguese (Brazil) <https://translate.wikibot.de/projects/"
|
"Language-Team: Portuguese (Brazil) <https://translate.wikibot.de/projects/"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||||
"X-Generator: Weblate 4.2.1\n"
|
"X-Generator: Weblate 4.2.1\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "Localização"
|
msgstr "Localização"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "Sobre mim"
|
msgstr "Sobre mim"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Link do Google"
|
msgstr "Link do Google"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Link do Facebook"
|
msgstr "Link do Facebook"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Link do Twitter"
|
msgstr "Link do Twitter"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Link do Reddit"
|
msgstr "Link do Reddit"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Link da Twitch"
|
msgstr "Link da Twitch"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "Link do PSN"
|
msgstr "Link do PSN"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "Link do VK"
|
msgstr "Link do VK"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "Link do XBL"
|
msgstr "Link do XBL"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Link da Steam"
|
msgstr "Link da Steam"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "Link do Discord"
|
msgstr "Link do Discord"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Link do Battle.net"
|
msgstr "Link do Battle.net"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__E mais__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Desconhecido"
|
msgstr "Desconhecido"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "desconhecido"
|
msgstr "desconhecido"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__E mais__"
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-03-18 13:59+0100\n"
|
"PO-Revision-Date: 2020-03-18 13:59+0100\n"
|
||||||
"Last-Translator: BabylonAS\n"
|
"Last-Translator: BabylonAS\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||||
"X-Generator: Poedit 2.3\n"
|
"X-Generator: Poedit 2.3\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "Местоположение"
|
msgstr "Местоположение"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "О себе"
|
msgstr "О себе"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Ссылка на учётную запись Google"
|
msgstr "Ссылка на учётную запись Google"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Ссылка на учётную запись Facebook"
|
msgstr "Ссылка на учётную запись Facebook"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Ссылка на учётную запись Twitter"
|
msgstr "Ссылка на учётную запись Twitter"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Ссылка на учётную запись Reddit"
|
msgstr "Ссылка на учётную запись Reddit"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Ссылка на учётную запись Twitch"
|
msgstr "Ссылка на учётную запись Twitch"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "Ссылка на учётную запись PSN"
|
msgstr "Ссылка на учётную запись PSN"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "Ссылка на учётную запись ВКонтакте"
|
msgstr "Ссылка на учётную запись ВКонтакте"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "Ссылка на учётную запись XBL"
|
msgstr "Ссылка на учётную запись XBL"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Ссылка на учётную запись Steam"
|
msgstr "Ссылка на учётную запись Steam"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "Ссылка на учётную запись Discord"
|
msgstr "Ссылка на учётную запись Discord"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Ссылка на учётную запись Battle.net"
|
msgstr "Ссылка на учётную запись Battle.net"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__И ещё__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "Неизвестно"
|
msgstr "Неизвестно"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "неизвестно"
|
msgstr "неизвестно"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__И ещё__"
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: RcGcDw\n"
|
"Project-Id-Version: RcGcDw\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-12-06 14:17+0000\n"
|
"PO-Revision-Date: 2020-12-06 14:17+0000\n"
|
||||||
"Last-Translator: lakejason0 <sunliyuan200402@outlook.com>\n"
|
"Last-Translator: lakejason0 <sunliyuan200402@outlook.com>\n"
|
||||||
"Language-Team: Chinese (Simplified) <https://translate.wikibot.de/projects/"
|
"Language-Team: Chinese (Simplified) <https://translate.wikibot.de/projects/"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
"X-Generator: Weblate 4.2.1\n"
|
"X-Generator: Weblate 4.2.1\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "位置"
|
msgstr "位置"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "关于我"
|
msgstr "关于我"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Google 链接"
|
msgstr "Google 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Facebook 链接"
|
msgstr "Facebook 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Twitter 链接"
|
msgstr "Twitter 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Reddit 链接"
|
msgstr "Reddit 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Twitch 链接"
|
msgstr "Twitch 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "PSN 链接"
|
msgstr "PSN 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "VK 链接"
|
msgstr "VK 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "XBL 链接"
|
msgstr "XBL 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Steam 链接"
|
msgstr "Steam 链接"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "Discord handle"
|
msgstr "Discord handle"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Battle.net handle"
|
msgstr "Battle.net handle"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__还有更多__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__还有更多__"
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: RcGcDw\n"
|
"Project-Id-Version: RcGcDw\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-06-16 23:56+0200\n"
|
"POT-Creation-Date: 2024-02-24 17:51+0100\n"
|
||||||
"PO-Revision-Date: 2020-08-16 19:13+0000\n"
|
"PO-Revision-Date: 2020-08-16 19:13+0000\n"
|
||||||
"Last-Translator: Winston Sung <>\n"
|
"Last-Translator: Winston Sung <>\n"
|
||||||
"Language-Team: Chinese (Traditional) <https://weblate.frisk.space/projects/"
|
"Language-Team: Chinese (Traditional) <https://weblate.frisk.space/projects/"
|
||||||
|
@ -19,70 +19,69 @@ msgstr ""
|
||||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
"X-Generator: Weblate 4.1.1\n"
|
"X-Generator: Weblate 4.1.1\n"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "Location"
|
msgid "Location"
|
||||||
msgstr "位置"
|
msgstr "位置"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:115
|
||||||
msgid "About me"
|
msgid "About me"
|
||||||
msgstr "關於我"
|
msgstr "關於我"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Google link"
|
msgid "Google link"
|
||||||
msgstr "Google 連結"
|
msgstr "Google 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:116
|
||||||
msgid "Facebook link"
|
msgid "Facebook link"
|
||||||
msgstr "Facebook 連結"
|
msgstr "Facebook 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Twitter link"
|
msgid "Twitter link"
|
||||||
msgstr "Twitter 連結"
|
msgstr "Twitter 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:117
|
||||||
msgid "Reddit link"
|
msgid "Reddit link"
|
||||||
msgstr "Reddit 連結"
|
msgstr "Reddit 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "Twitch link"
|
msgid "Twitch link"
|
||||||
msgstr "Twitch 連結"
|
msgstr "Twitch 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:118
|
||||||
msgid "PSN link"
|
msgid "PSN link"
|
||||||
msgstr "PSN 連結"
|
msgstr "PSN 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "VK link"
|
msgid "VK link"
|
||||||
msgstr "VK 連結"
|
msgstr "VK 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:119
|
||||||
msgid "XBL link"
|
msgid "XBL link"
|
||||||
msgstr "XBL 連結"
|
msgstr "XBL 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Steam link"
|
msgid "Steam link"
|
||||||
msgstr "Steam 連結"
|
msgstr "Steam 連結"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:120
|
||||||
msgid "Discord handle"
|
msgid "Discord handle"
|
||||||
msgstr "Discord handle"
|
msgstr "Discord handle"
|
||||||
|
|
||||||
#: src/misc.py:45
|
#: src/misc.py:121
|
||||||
msgid "Battle.net handle"
|
msgid "Battle.net handle"
|
||||||
msgstr "Battle.net handle"
|
msgstr "Battle.net handle"
|
||||||
|
|
||||||
#: src/misc.py:140
|
#: src/misc.py:127
|
||||||
msgid ""
|
|
||||||
"\n"
|
|
||||||
"__And more__"
|
|
||||||
msgstr ""
|
|
||||||
"\n"
|
|
||||||
"__還有更多__"
|
|
||||||
|
|
||||||
#: src/misc.py:330
|
|
||||||
msgid "Unknown"
|
msgid "Unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
#: src/misc.py:332
|
#: src/misc.py:129
|
||||||
msgid "unknown"
|
msgid "unknown"
|
||||||
msgstr "未知"
|
msgstr "未知"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__And more__"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "\n"
|
||||||
|
#~ "__還有更多__"
|
||||||
|
|
20
src/bot.py
20
src/bot.py
|
@ -12,6 +12,7 @@ from contextlib import asynccontextmanager
|
||||||
|
|
||||||
from src.discussions import Discussions
|
from src.discussions import Discussions
|
||||||
from src.discord.queue import messagequeue
|
from src.discord.queue import messagequeue
|
||||||
|
from src.discord.message import DiscordMessage
|
||||||
from src.argparser import command_line_args
|
from src.argparser import command_line_args
|
||||||
from src.config import settings
|
from src.config import settings
|
||||||
from src.database import db
|
from src.database import db
|
||||||
|
@ -75,13 +76,13 @@ async def message_sender():
|
||||||
logger.info("Shutting down after sending {} more Discord messages...".format(len(messagequeue)))
|
logger.info("Shutting down after sending {} more Discord messages...".format(len(messagequeue)))
|
||||||
await messagequeue.resend_msgs()
|
await messagequeue.resend_msgs()
|
||||||
pass
|
pass
|
||||||
except:
|
except Exception as ex:
|
||||||
if command_line_args.debug:
|
if command_line_args.debug:
|
||||||
logger.exception("Exception on DC message sender")
|
logger.exception("Exception on DC message sender")
|
||||||
shutdown(loop=asyncio.get_event_loop())
|
shutdown(loop=asyncio.get_event_loop())
|
||||||
else:
|
else:
|
||||||
logger.exception("Exception on DC message sender")
|
logger.exception("Exception on DC message sender")
|
||||||
# await generic_msg_sender_exception_logger(traceback.format_exc(), "Message sender exception") # TODO
|
await send_exception_to_monitoring(ex)
|
||||||
|
|
||||||
|
|
||||||
# async def discussion_handler():
|
# async def discussion_handler():
|
||||||
|
@ -229,6 +230,21 @@ def shutdown(loop, signal=None):
|
||||||
# else:
|
# else:
|
||||||
# shutdown(loop)
|
# shutdown(loop)
|
||||||
|
|
||||||
|
async def send_exception_to_monitoring(ex: Exception):
|
||||||
|
discord_message = DiscordMessage("embed", "generic", [""])
|
||||||
|
discord_message["title"] = "Discord message queue has crashed, restart is needed!"
|
||||||
|
discord_message["content"] = "Crash information: " + str(ex)
|
||||||
|
discord_message.finish_embed_message()
|
||||||
|
header = settings["header"]
|
||||||
|
header['Content-Type'] = 'application/json'
|
||||||
|
header['X-RateLimit-Precision'] = "millisecond"
|
||||||
|
try:
|
||||||
|
async with aiohttp.ClientSession(headers=header, timeout=aiohttp.ClientTimeout(total=6)) as session:
|
||||||
|
async with session.post("https://discord.com/api/webhooks/{}".format(settings["monitoring_webhook"]),
|
||||||
|
data=repr(discord_message)) as resp:
|
||||||
|
pass
|
||||||
|
except (aiohttp.ServerConnectionError, aiohttp.ServerTimeoutError):
|
||||||
|
logger.exception("Couldn't communicate with Discord as a result of Server Error when trying to signal domain task issue!")
|
||||||
|
|
||||||
async def main_loop():
|
async def main_loop():
|
||||||
global main_tasks
|
global main_tasks
|
||||||
|
|
|
@ -29,7 +29,8 @@ class Domain:
|
||||||
self.task: Optional[asyncio.Task] = None
|
self.task: Optional[asyncio.Task] = None
|
||||||
self.wikis: OrderedDict[str, src.wiki.Wiki] = OrderedDict()
|
self.wikis: OrderedDict[str, src.wiki.Wiki] = OrderedDict()
|
||||||
self.irc: Optional[src.irc_feed.AioIRCCat] = None
|
self.irc: Optional[src.irc_feed.AioIRCCat] = None
|
||||||
self.failures = 0
|
self.last_failure_report = 0
|
||||||
|
self.failure_data = [0, 0, 0] # Amount of failures, timestamp of last failure info, count of announcements
|
||||||
# self.discussions_handler: Optional[Discussions] = Discussions(self.wikis) if name == "fandom.com" else None
|
# self.discussions_handler: Optional[Discussions] = Discussions(self.wikis) if name == "fandom.com" else None
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
@ -37,7 +38,7 @@ class Domain:
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return (f"<Domain name='{self.name}' task='{self.task}' wikis='{self.wikis}' "
|
return (f"<Domain name='{self.name}' task='{self.task}' wikis='{self.wikis}' "
|
||||||
f"irc='{self.irc.connection.connected if self.irc else False}' failures={self.failures} "
|
f"irc='{self.irc.connection.connected if self.irc else False}' "
|
||||||
f"calculated_delay={self.calculate_sleep_time(len(self)) if not self.irc else 'handled by IRC scheduler'}>")
|
f"calculated_delay={self.calculate_sleep_time(len(self)) if not self.irc else 'handled by IRC scheduler'}>")
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
@ -101,6 +102,33 @@ class Domain:
|
||||||
wiki.statistics.update(Log(type=LogType.SCAN_REASON, title=str(reason)))
|
wiki.statistics.update(Log(type=LogType.SCAN_REASON, title=str(reason)))
|
||||||
self.wikis.move_to_end(wiki.script_url)
|
self.wikis.move_to_end(wiki.script_url)
|
||||||
|
|
||||||
|
def failure_rate_investigation(self) -> Optional[set]:
|
||||||
|
"""Function is supposed to determine if a notification should be sent regarding a wiki/domain not working properly
|
||||||
|
|
||||||
|
Cases considered worthy of notification:
|
||||||
|
An entire farm (20% of wikis when 15+ wikis from domain) is responding with errors for the past 10 minutes
|
||||||
|
A single wiki returning connection errors either for full queue_length or for an hour
|
||||||
|
"""
|
||||||
|
if len(self) > 15:
|
||||||
|
affected = set()
|
||||||
|
for wiki_url, wiki_obj in self.wikis.items():
|
||||||
|
failures = 0
|
||||||
|
logs_last_10 = wiki_obj.statistics.filter_by_time(10 * 60)
|
||||||
|
for log in logs_last_10:
|
||||||
|
if log.type == LogType.CONNECTION_ERROR:
|
||||||
|
failures += 1
|
||||||
|
if len(logs_last_10)/2 <= failures:
|
||||||
|
affected.add(wiki_url)
|
||||||
|
if len(affected) > len(self)/5:
|
||||||
|
return affected
|
||||||
|
else:
|
||||||
|
affected = set()
|
||||||
|
for wiki_url, wiki_obj in self.wikis.items():
|
||||||
|
if all([x for x in wiki_obj.statistics.filter_by_time(60*60) if x.type in (LogType.CONNECTION_ERROR, LogType.SCAN_REASON, LogType.HTTP_ERROR)]):
|
||||||
|
affected.add(wiki_url)
|
||||||
|
if affected:
|
||||||
|
return affected
|
||||||
|
|
||||||
async def irc_scheduler(self):
|
async def irc_scheduler(self):
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
@ -123,12 +151,14 @@ class Domain:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if command_line_args.debug:
|
if command_line_args.debug:
|
||||||
logger.exception("IRC scheduler task for domain {} failed!".format(self.name))
|
logger.exception("IRC scheduler task for domain {} failed!".format(self.name))
|
||||||
else:
|
else: # production
|
||||||
self.failures += 1
|
if not (time.time()-172800 > self.last_failure_report): # If we haven't reported for more than 2 days or at all
|
||||||
|
return
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
await self.send_exception_to_monitoring(e)
|
wikis = self.failure_rate_investigation()
|
||||||
if self.failures > 5:
|
if wikis:
|
||||||
raise asyncio.exceptions.CancelledError
|
await self.send_exception_to_monitoring(e, wikis)
|
||||||
|
self.last_failure_report = time.time()
|
||||||
|
|
||||||
async def regular_scheduler(self):
|
async def regular_scheduler(self):
|
||||||
try:
|
try:
|
||||||
|
@ -139,11 +169,13 @@ class Domain:
|
||||||
if command_line_args.debug:
|
if command_line_args.debug:
|
||||||
logger.exception("Regular scheduler task for domain {} failed!".format(self.name))
|
logger.exception("Regular scheduler task for domain {} failed!".format(self.name))
|
||||||
else:
|
else:
|
||||||
self.failures += 1
|
if not (time.time()-172800 > self.last_failure_report): # If we haven't reported for more than 2 days or at all
|
||||||
await self.send_exception_to_monitoring(e)
|
return
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
if self.failures > 5:
|
wikis = self.failure_rate_investigation()
|
||||||
raise asyncio.exceptions.CancelledError
|
if wikis:
|
||||||
|
await self.send_exception_to_monitoring(e, wikis)
|
||||||
|
self.last_failure_report = time.time()
|
||||||
|
|
||||||
@cache
|
@cache
|
||||||
def calculate_sleep_time(self, queue_length: int):
|
def calculate_sleep_time(self, queue_length: int):
|
||||||
|
@ -170,11 +202,11 @@ class Domain:
|
||||||
await wiki.session.close()
|
await wiki.session.close()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
async def send_exception_to_monitoring(self, ex: Exception):
|
async def send_exception_to_monitoring(self, ex: Exception, wikis: set):
|
||||||
discord_message = DiscordMessage("embed", "generic", [""])
|
discord_message = DiscordMessage("embed", "generic", [""])
|
||||||
discord_message["title"] = "Domain scheduler exception for {} (recovered)".format(self.name)
|
discord_message["title"] = "Domain scheduler exception for {} (recovered)".format(self.name)
|
||||||
discord_message["content"] = str(ex)[0:1995]
|
discord_message["content"] = "Affected wikis: {}".format(", ".join(wikis)) + "\n" + str(ex)
|
||||||
discord_message.add_field("Failure count", str(self.failures))
|
# discord_message.add_field("Failure count", str(self.failures))
|
||||||
discord_message.finish_embed_message()
|
discord_message.finish_embed_message()
|
||||||
header = settings["header"]
|
header = settings["header"]
|
||||||
header['Content-Type'] = 'application/json'
|
header['Content-Type'] = 'application/json'
|
||||||
|
|
|
@ -18,7 +18,13 @@ if TYPE_CHECKING:
|
||||||
class AioIRCCat(irc.client_aio.AioSimpleIRCClient):
|
class AioIRCCat(irc.client_aio.AioSimpleIRCClient):
|
||||||
def connect(self, *args, **kwargs):
|
def connect(self, *args, **kwargs):
|
||||||
logger.debug("Connecting with {}...".format(args))
|
logger.debug("Connecting with {}...".format(args))
|
||||||
super().connect(*args, **kwargs)
|
while True:
|
||||||
|
try:
|
||||||
|
super().connect(*args, **kwargs)
|
||||||
|
break
|
||||||
|
except ConnectionRefusedError as error: # hopefully picked up by self.activity_tester
|
||||||
|
logger.exception("Could not connect with IRC!")
|
||||||
|
pass
|
||||||
self.connection_details = (args, kwargs)
|
self.connection_details = (args, kwargs)
|
||||||
|
|
||||||
def __init__(self, targets: dict[str, str], domain_object: Domain, rc_callback: Optional[Callable], discussion_callback: Optional[Callable]):
|
def __init__(self, targets: dict[str, str], domain_object: Domain, rc_callback: Optional[Callable], discussion_callback: Optional[Callable]):
|
||||||
|
|
|
@ -3,7 +3,7 @@ from datetime import datetime
|
||||||
import aiohttp.web_request
|
import aiohttp.web_request
|
||||||
|
|
||||||
from src.config import settings
|
from src.config import settings
|
||||||
from typing import Union, Optional
|
from typing import Union, Optional, List
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,12 +65,12 @@ class Statistics:
|
||||||
for log in args:
|
for log in args:
|
||||||
self.logs.append(log)
|
self.logs.append(log)
|
||||||
|
|
||||||
def filter_by_time(self, time_ago: int, logs: list = None): # cannot have self.logs in here as this is evaluated once
|
def filter_by_time(self, time_ago: int, logs: list = None) -> List[Log]: # cannot have self.logs in here as this is evaluated once
|
||||||
"""Returns logs with time between time_ago seconds ago and now"""
|
"""Returns logs with time between time_ago seconds ago and now"""
|
||||||
time_limit = int(time.time()) - time_ago
|
time_limit = int(time.time()) - time_ago
|
||||||
return [x for x in (self.logs if logs is None else logs) if x.time > time_limit]
|
return [x for x in (self.logs if logs is None else logs) if x.time > time_limit]
|
||||||
|
|
||||||
def filter_by_type(self, log_type: LogType, logs: list = None):
|
def filter_by_type(self, log_type: LogType, logs: list = None) -> List[Log]:
|
||||||
"""Returns logs with same type as in log_type"""
|
"""Returns logs with same type as in log_type"""
|
||||||
return [x for x in (self.logs if logs is None else logs) if x.type == log_type]
|
return [x for x in (self.logs if logs is None else logs) if x.type == log_type]
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ class Wiki:
|
||||||
# If WikiServerError comes up 2 times in recent 2 minutes, this will reraise the exception, otherwise waits 2 seconds and retries
|
# If WikiServerError comes up 2 times in recent 2 minutes, this will reraise the exception, otherwise waits 2 seconds and retries
|
||||||
self.statistics.update(Log(type=LogType.CONNECTION_ERROR, title=str(e.exception)))
|
self.statistics.update(Log(type=LogType.CONNECTION_ERROR, title=str(e.exception)))
|
||||||
if self.statistics.recent_connection_errors() > 9:
|
if self.statistics.recent_connection_errors() > 9:
|
||||||
raise
|
raise e
|
||||||
await asyncio.sleep(2.0)
|
await asyncio.sleep(2.0)
|
||||||
continue
|
continue
|
||||||
if not self.mw_messages or self.recache_requested:
|
if not self.mw_messages or self.recache_requested:
|
||||||
|
@ -360,7 +360,10 @@ class Wiki:
|
||||||
else:
|
else:
|
||||||
self.statistics.update(last_action=0)
|
self.statistics.update(last_action=0)
|
||||||
dbmanager.add(("UPDATE rcgcdb SET rcid = 0 WHERE wiki = $1 AND ( rcid != -1 OR rcid IS NULL )", (self.script_url)))
|
dbmanager.add(("UPDATE rcgcdb SET rcid = 0 WHERE wiki = $1 AND ( rcid != -1 OR rcid IS NULL )", (self.script_url)))
|
||||||
return # TODO Add a log entry?
|
self.statistics.update(Log(type=LogType.VALUE_UPDATE,
|
||||||
|
title="Commited first fetch and updated rcid value from {} to {}".format(
|
||||||
|
self.rc_id, self.statistics.last_action)))
|
||||||
|
return
|
||||||
categorize_events = {}
|
categorize_events = {}
|
||||||
new_events = 0
|
new_events = 0
|
||||||
self.statistics.last_checked_rc = int(time.time())
|
self.statistics.last_checked_rc = int(time.time())
|
||||||
|
|
Loading…
Reference in a new issue