This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: don't crash if firebase not initalized

+7 -2
+3 -2
config.go
··· 58 58 59 59 err = setupFirebaseClient() 60 60 if err != nil { 61 - panic(fmt.Errorf("could not setup firebase client: %w", err)) 61 + ll.ErrorDisplay("could not setup firebase client", err) 62 + } else { 63 + ll.Log("Initialized", "cyan", "firebase client") 62 64 } 63 - ll.Log("Initialized", "cyan", "firebase client") 64 65 65 66 redisClient = redis.NewClient(&redis.Options{ 66 67 Addr: strings.TrimPrefix(config.RedisURL, "redis://"),
+4
firebase.go
··· 23 23 const MaxTokensPerRequest = 490 24 24 25 25 func (msg Message) SendToFirebase(groupId string, subs []Subscription) error { 26 + if firebaseClient == nil || !config.HasValidFirebaseServiceAccount() { 27 + return nil 28 + } 29 + 26 30 fcm, err := firebaseClient.Messaging(firebaseCtx) 27 31 if err != nil { 28 32 return fmt.Errorf("while initializing FCM client: %w", err)