Skip to content

Commit

Permalink
update dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
vildan-valeev committed Dec 30, 2023
1 parent d28802e commit 9fe21ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"log"
"net/http"
"sync"
"time"
)

type Bot interface {
Expand Down Expand Up @@ -74,8 +73,6 @@ func (d *Dispatcher) PollOptions(dropPendingUpdates bool) error {
for {
//TODO: сброс апдейтов

time.Sleep(1000 * time.Millisecond)

result, err := d.api.GetUpdates(&d.opts)
if err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func get[T Response](base, endpoint string, vals url.Values) (res T, err error)
if err != nil {
return res, err
}
log.Printf("Response Error: %v", err)
log.Printf("Response BODY: %s", string(cnt))
//log.Printf("Response Error: %v", err)
//log.Printf("Response BODY: %s", string(cnt))
if err = json.Unmarshal(cnt, &res); err != nil {
return
}
Expand Down Expand Up @@ -60,6 +60,7 @@ func check(r Response) error {
return nil
// TODO: add another codes https://vk.com/dev/errors
default:
log.Println(e.Error())
return e
}
}

0 comments on commit 9fe21ed

Please sign in to comment.