fix(irc): rewrite handler pipeline (#399)

* fix(irc): rewrite handler pipeline

This might be overkill but the pipeline has been made event driven. I've tested on a couple networks, and bouncing nicks / connections brings it back every time. creating the a different branch from https://github.com/autobrr/autobrr/pull/398 because it's pretty intrusive (and I didn't apply the GUI changes).

* fix(irc): couple adjustments

* fix(irc): deadlocks

* fix: add missing dependency

* fix(irc): remove more locks from connect cmds

* feat(irc): conditional monitoring message

* feat(irc): show unhealthy network in ui

* feat(irc): improve logs and comments
This commit is contained in:
Kyle Sanderson 2022-08-12 06:32:02 -07:00 committed by GitHub
parent 4c93cac248
commit 7deac6a781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 317 additions and 281 deletions

View file

@ -86,7 +86,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
return (
<li key={idx}>
<div className="grid grid-cols-12 gap-2 lg:gap-4 items-center hover:bg-gray-50 dark:hover:bg-gray-700 py-4">
<div className={classNames("grid grid-cols-12 gap-2 lg:gap-4 items-center py-4", network.enabled && !network.healthy ? "bg-red-50 dark:bg-red-900 hover:bg-red-100 dark:hover:bg-red-800" : "hover:bg-gray-50 dark:hover:bg-gray-700 ")}>
<IrcNetworkUpdateForm
isOpen={updateIsOpen}
toggle={toggleUpdate}
@ -100,7 +100,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
<div className="flex">
<span className="relative inline-flex items-center ml-1">
{network.enabled ? (
IsNetworkHealthy(network) ? (
network.healthy ? (
<span
className="mr-3 flex h-3 w-3 relative"
title={`Connected since: ${simplifyDate(network.connected_since)}`}
@ -113,7 +113,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
className="mr-3 flex items-center"
title={network.connection_errors.toString()}
>
<ExclamationCircleIcon className="h-4 w-4 text-red-400 hover:text-red-600" />
<ExclamationCircleIcon className="h-4 w-4 text-yellow-400 hover:text-yellow-600" />
</span>
)
) : (
@ -238,6 +238,3 @@ const ListItem = ({ idx, network }: ListItemProps) => {
</li>
);
};
const IsNetworkHealthy = (network: IrcNetworkWithHealth) =>
network.connection_errors.length <= 0;