парсер новый
This commit is contained in:
@@ -13,7 +13,7 @@ func (uc *UseCase) FetchChannelMeta(ctx context.Context, username string) (domai
|
||||
return domain.Channel{}, fmt.Errorf("uc.telegram.ParseChannelMeta: %s", err)
|
||||
}
|
||||
|
||||
err = uc.database.UpdateChannelIfNotAccessible(ctx, channel.TelegramID)
|
||||
err = uc.database.UpdateChannelIfNotAccessible(ctx, channel)
|
||||
if err != nil {
|
||||
return domain.Channel{}, fmt.Errorf("uc.database.UpdateChannelIfNotAccessible: %s", err)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ func (uc *UseCase) FetchChannelMetaByInvite(ctx context.Context, inviteLink stri
|
||||
return domain.Channel{}, fmt.Errorf("uc.telegram.ParseChannelMetaByInvite: %s", err)
|
||||
}
|
||||
|
||||
err = uc.database.UpdateChannelIfNotAccessible(ctx, channel.TelegramID)
|
||||
err = uc.database.UpdateChannelIfNotAccessible(ctx, channel)
|
||||
if err != nil {
|
||||
return domain.Channel{}, fmt.Errorf("uc.database.UpdateChannelIfNotAccessible: %s", err)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
func (uc *UseCase) FetchChannels(ctx context.Context) error {
|
||||
channels := uc.database.GetChannels(ctx)
|
||||
log.Debug().Msg("start fetch channels")
|
||||
|
||||
for _, c := range channels {
|
||||
if c.Pts == 0 {
|
||||
@@ -115,6 +116,7 @@ func (uc *UseCase) rejoinChannel(ctx context.Context, channel domain.Channel) {
|
||||
}
|
||||
|
||||
func (uc *UseCase) initializeChannel(ctx context.Context, channel domain.Channel) {
|
||||
log.Debug().Stringer("ch", channel).Msg("init channel")
|
||||
var (
|
||||
updated domain.Channel
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user