code: func (c *folderSummaryService) foldersToHandle() []string {
  	// We only recalculate summaries if someone is listening to events
  	// (a request to /rest/events has been made within the last
  	// pingEventInterval).
  
  	c.lastEventReqMut.Lock()
  	last := c.lastEventReq
  	c.lastEventReqMut.Unlock()
  	if time.Since(last) > minSummaryInterval {
  		return nil
  	}
  
  	c.foldersMut.Lock()
  	res := make([]string, 0, len(c.folders))
  	for folder := range c.folders {
  		res = append(res, folder)
  		delete(c.folders, folder)
  	}
  	c.foldersMut.Unlock()
  	return res
  }
docs: // foldersToHandle returns the list of folders needing a summary update, and
  // clears the list.