A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

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

Report active user count to metrics

+10
+6
internal/db/oauth_store.go
··· 76 76 return ids, rows.Err() 77 77 } 78 78 79 + func (s *OAuthStore) CountActiveUsers(ctx context.Context) (int, error) { 80 + var count int 81 + err := s.db.QueryRowContext(ctx, `SELECT COUNT(DISTINCT account_did) FROM oauth_sessions`).Scan(&count) 82 + return count, err 83 + } 84 + 79 85 func (s *OAuthStore) GetAuthRequestInfo(ctx context.Context, state string) (*oauth.AuthRequestData, error) { 80 86 var data []byte 81 87 err := s.db.QueryRowContext(ctx, `
+4
internal/server/server.go
··· 470 470 } 471 471 472 472 func (s *Server) runSyncAll(ctx context.Context) { 473 + if n, err := s.oauthStore.CountActiveUsers(ctx); err == nil { 474 + metrics.ActiveUsers.Set(float64(n)) 475 + } 476 + 473 477 users, err := s.dbs.Users.ListUsers(ctx) 474 478 if err != nil { 475 479 s.logger.Error("failed to list users for sync", "error", err)