Probably fixed issue with twitch
This commit is contained in:
parent
5ecd5a8a31
commit
b0cf3e2f15
|
@ -199,7 +199,7 @@ func getEventSubscriptions(ctx context.Context) ([]twitchEventSub, error) {
|
||||||
type twitchResponse struct {
|
type twitchResponse struct {
|
||||||
Data []eventSub `json:"data"`
|
Data []eventSub `json:"data"`
|
||||||
Pagination *struct {
|
Pagination *struct {
|
||||||
After string `json:"after"`
|
After string `json:"cursor"`
|
||||||
} `json:"pagination"`
|
} `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,6 @@ func syncWithTwitch(ctx context.Context, dbConn *pgxpool.Pool, updateAll bool) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
p.EndBlock()
|
p.EndBlock()
|
||||||
log.Info().Interface("Subscriptions", subscriptions).Msg("Got subs from twitch")
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventSubNone = 0 // No event of this type found
|
EventSubNone = 0 // No event of this type found
|
||||||
|
@ -271,7 +270,6 @@ func syncWithTwitch(ctx context.Context, dbConn *pgxpool.Pool, updateAll bool) {
|
||||||
for twitchID, evStatuses := range streamerEventSubs {
|
for twitchID, evStatuses := range streamerEventSubs {
|
||||||
for evType, isSubbed := range evStatuses {
|
for evType, isSubbed := range evStatuses {
|
||||||
if !isSubbed {
|
if !isSubbed {
|
||||||
log.Info().Str("TwitchID", twitchID).Str("Type", evType).Msg("Subscribing")
|
|
||||||
err = subscribeToEvent(ctx, evType, twitchID)
|
err = subscribeToEvent(ctx, evType, twitchID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Error while monitoring twitch")
|
log.Error().Err(err).Msg("Error while monitoring twitch")
|
||||||
|
|
Loading…
Reference in New Issue