mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-05 05:54:55 +08:00
fix: check command
This commit is contained in:
parent
8976955ea7
commit
7fb61509da
1 changed files with 2 additions and 8 deletions
10
cmd/check.go
10
cmd/check.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue