List all users for which we have a TSDB. We do it here in order to keep the mutex locked for the shortest time possible.
()
| 2762 | // List all users for which we have a TSDB. We do it here in order |
| 2763 | // to keep the mutex locked for the shortest time possible. |
| 2764 | func (i *Ingester) getTSDBUsers() []string { |
| 2765 | i.stoppedMtx.RLock() |
| 2766 | defer i.stoppedMtx.RUnlock() |
| 2767 | |
| 2768 | ids := make([]string, 0, len(i.TSDBState.dbs)) |
| 2769 | for userID := range i.TSDBState.dbs { |
| 2770 | ids = append(ids, userID) |
| 2771 | } |
| 2772 | |
| 2773 | return ids |
| 2774 | } |
| 2775 | |
| 2776 | func (i *Ingester) getOrCreateTSDB(userID string, force bool) (*userTSDB, error) { |
| 2777 | db, err := i.getTSDB(userID) |
no outgoing calls