From 37b9ef28691d23e27806621dac0743abda6f3d19 Mon Sep 17 00:00:00 2001 From: akrherz Date: Thu, 26 Sep 2024 10:24:16 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A5=20Lame=20thread=20count=20incr?= =?UTF-8?q?ease?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iembot.tac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iembot.tac b/iembot.tac index 15bd941..1baeacc 100644 --- a/iembot.tac +++ b/iembot.tac @@ -58,4 +58,5 @@ r.setServiceParent(serviceCollection) # Increase threadpool size to do more work at once # 128 not large enough when SPC's products come through :/ -reactor.getThreadPool().adjustPoolsize(maxthreads=256) +# 256 is not enough for hurricanes +reactor.getThreadPool().adjustPoolsize(maxthreads=512) From aacccee6f3cdc337cd7a6f11df11576a8e56449d Mon Sep 17 00:00:00 2001 From: akrherz Date: Thu, 26 Sep 2024 10:24:56 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20ruff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- conftest.py | 3 ++- tests/test_util.py | 10 +++++----- tests/test_util_channels.py | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea8ec06..f99ea94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_schedule: quarterly repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.1" + rev: "v0.6.8" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/conftest.py b/conftest.py index f28f6f5..3cae0d1 100644 --- a/conftest.py +++ b/conftest.py @@ -2,9 +2,10 @@ # third party import pytest -from iembot.basicbot import basicbot from pyiem.database import get_dbconnc +from iembot.basicbot import basicbot + @pytest.fixture() def bot(): diff --git a/tests/test_util.py b/tests/test_util.py index b14b3b6..856cf49 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,17 +3,17 @@ import tempfile from unittest import mock -# local -import iembot.util as botutil - # Third party modules import pytest -from iembot.basicbot import basicbot -from iembot.iemchatbot import JabberClient from twisted.python.failure import Failure from twisted.words.xish.domish import Element from twitter.error import TwitterError +# local +import iembot.util as botutil +from iembot.basicbot import basicbot +from iembot.iemchatbot import JabberClient + @pytest.mark.parametrize("database", ["mesosite"]) def test_load_mastodon_from_db(dbcursor): diff --git a/tests/test_util_channels.py b/tests/test_util_channels.py index b20b346..97ff5be 100644 --- a/tests/test_util_channels.py +++ b/tests/test_util_channels.py @@ -1,6 +1,7 @@ """Test things done with channel subs.""" import pytest + from iembot.util import ( channels_room_add, channels_room_del, From 2a5f6c1e8e47b2768f89ff30e728924decded355 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:25:49 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- iembot.tac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iembot.tac b/iembot.tac index 1baeacc..ca3d444 100644 --- a/iembot.tac +++ b/iembot.tac @@ -3,8 +3,6 @@ # Base Python import json -# Local Import -from iembot import iemchatbot, webservices from psycopg.rows import dict_row # Twisted Bits @@ -14,6 +12,9 @@ from twisted.internet import reactor from twisted.web import server from txyam.client import YamClient +# Local Import +from iembot import iemchatbot, webservices + with open("settings.json", encoding="utf-8") as fh: dbconfig = json.load(fh)