mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
Add documentation for aliases.
Reload aliases for every summary request.
This commit is contained in:
@ -14,7 +14,7 @@ type AliasService struct {
|
||||
|
||||
var userAliases map[string][]*models.Alias
|
||||
|
||||
func (srv *AliasService) InitUser(userId string) error {
|
||||
func (srv *AliasService) LoadUserAliases(userId string) error {
|
||||
if userAliases == nil {
|
||||
userAliases = make(map[string][]*models.Alias)
|
||||
}
|
||||
|
@ -28,6 +28,10 @@ func (srv *SummaryService) GetSummary(from, to time.Time, user *models.User) (*m
|
||||
var editorItems []models.SummaryItem
|
||||
var osItems []models.SummaryItem
|
||||
|
||||
if err := srv.AliasService.LoadUserAliases(user.ID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c := make(chan models.SummaryItemContainer)
|
||||
for _, t := range types {
|
||||
go srv.aggregateBy(heartbeats, t, user, c)
|
||||
|
Reference in New Issue
Block a user