fix: check command

This commit is contained in:
Bhunter 2025-01-31 14:10:30 +01:00
parent 8976955ea7
commit 7fb61509da

View file

@ -398,13 +398,7 @@ func runCheckCmd(cmd *cobra.Command, cfg *config.ServerCmdConfig) {
lg.Fatalw("no channels found")
}
tgconfig := &config.TGConfig{
RateLimit: true,
RateBurst: 5,
Rate: 100,
}
middlewares := tgc.NewMiddleware(tgconfig, tgc.WithFloodWait(), tgc.WithRateLimit())
middlewares := tgc.NewMiddleware(&cfg.TG, tgc.WithFloodWait(), tgc.WithRateLimit())
export, _ := cmd.Flags().GetBool("export")
clean, _ := cmd.Flags().GetBool("clean")
concurrent, _ := cmd.Flags().GetInt("concurrent")
@ -441,7 +435,7 @@ func runCheckCmd(cmd *cobra.Command, cfg *config.ServerCmdConfig) {
g.Go(func() error {
client, err := tgc.AuthClient(ctx, tgconfig, session.Session, middlewares...)
client, err := tgc.AuthClient(ctx, &cfg.TG, session.Session, middlewares...)
if err != nil {
lg.Errorw("failed to create client", "err", err, "channel", id)
return fmt.Errorf("failed to create client for channel %d: %w", id, err)