@@ -53,6 +53,9 @@ func (app *App) initClients(ctx context.Context) error {
5353 turnClient .SetAuthToken (token )
5454 app .turnClient = turnClient
5555
56+ // Initialize sprinkler monitor for real-time events
57+ app .sprinklerMonitor = newSprinklerMonitor (app , token )
58+
5659 return nil
5760}
5861
@@ -405,6 +408,22 @@ func (app *App) fetchPRsInternal(ctx context.Context) (incoming []PR, outgoing [
405408 // Only log summary, not individual PRs
406409 slog .Info ("[GITHUB] GitHub PR summary" , "incoming" , len (incoming ), "outgoing" , len (outgoing ))
407410
411+ // Update sprinkler monitor with discovered orgs
412+ app .mu .RLock ()
413+ orgs := make ([]string , 0 , len (app .seenOrgs ))
414+ for org := range app .seenOrgs {
415+ orgs = append (orgs , org )
416+ }
417+ app .mu .RUnlock ()
418+
419+ if app .sprinklerMonitor != nil && len (orgs ) > 0 {
420+ app .sprinklerMonitor .updateOrgs (orgs )
421+ // Start monitor if not already running
422+ if err := app .sprinklerMonitor .start (); err != nil {
423+ slog .Warn ("[SPRINKLER] Failed to start monitor" , "error" , err )
424+ }
425+ }
426+
408427 // Fetch Turn API data
409428 // Always synchronous now for simplicity - Turn API calls are fast with caching
410429 app .fetchTurnDataSync (ctx , allIssues , user , & incoming , & outgoing )
0 commit comments