mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(irc): set proxy if use proxy is enabled (#2011)
fix(irc): set proxy is use proxy is enabled
This commit is contained in:
parent
e137ac4070
commit
6b2b1637cb
1 changed files with 34 additions and 32 deletions
|
@ -83,11 +83,11 @@ func (s *service) StartHandlers() {
|
|||
continue
|
||||
}
|
||||
|
||||
if network.ProxyId != 0 {
|
||||
if network.UseProxy && network.ProxyId != 0 {
|
||||
networkProxy, err := s.proxyService.FindByID(context.Background(), network.ProxyId)
|
||||
if err != nil {
|
||||
s.log.Error().Err(err).Msgf("failed to get proxy for network: %s", network.Server)
|
||||
return
|
||||
continue
|
||||
}
|
||||
network.Proxy = networkProxy
|
||||
}
|
||||
|
@ -147,7 +147,10 @@ func (s *service) startNetwork(network domain.IrcNetwork) error {
|
|||
}
|
||||
}(existingHandler)
|
||||
}
|
||||
} else {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// if not found in handlers, lets add it and run it
|
||||
channels, err := s.repo.ListChannels(network.ID)
|
||||
if err != nil {
|
||||
|
@ -178,7 +181,6 @@ func (s *service) startNetwork(network domain.IrcNetwork) error {
|
|||
s.log.Error().Err(err).Msgf("failed to start handler for network: %s", network.Name)
|
||||
}
|
||||
}(network)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue