mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-21 13:39:22 +01:00
feat: remove postgres token fetch from livestream (#23089)
Co-authored-by: James Greenhill <fuziontech@gmail.com>
This commit is contained in:
parent
367f6f8360
commit
c34a1b229f
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@ -124,12 +125,7 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
teamIdInt := int(claims["team_id"].(float64))
|
||||
|
||||
token, err := tokenFromTeamId(teamIdInt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
token := fmt.Sprint(claims["api_token"])
|
||||
|
||||
var hash *expirable.LRU[string, string]
|
||||
var ok bool
|
||||
@ -175,6 +171,7 @@ func main() {
|
||||
return err
|
||||
}
|
||||
teamId = strconv.Itoa(int(claims["team_id"].(float64)))
|
||||
token = fmt.Sprint(claims["api_token"])
|
||||
|
||||
log.Printf("~~~~ team found %s", teamId)
|
||||
if teamId == "" {
|
||||
@ -182,19 +179,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if teamId != "" {
|
||||
teamIdInt64, err := strconv.ParseInt(teamId, 10, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
teamIdInt := int(teamIdInt64)
|
||||
token, err = tokenFromTeamId(teamIdInt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
eventTypes := []string{}
|
||||
if eventType != "" {
|
||||
eventTypes = strings.Split(eventType, ",")
|
||||
|
Loading…
Reference in New Issue
Block a user