fix(projects): load projects only one when fetching subscriptions for a bunch of projects at once
This change ensures already loaded projects are passed down when fetching their subscription instead of re-loading each project with a single sql statement. When loading all projects, this meant all projects were loaded twice, which was highly inefficient. This roughly added 25ms to each request, assuming the per page limit was maxed out at 50 projects. Empirical testing shows this change reduces load times by ~20ms. Because the request is already pretty fast, this is ~30% of the overall request time, making the loading of projects now even faster
This commit is contained in:
@ -139,7 +139,7 @@ func RegisterOverdueReminderCron() {
|
||||
}
|
||||
}
|
||||
|
||||
projects, err := GetProjectsSimplByTaskIDs(s, taskIDs)
|
||||
projects, err := GetProjectsMapSimplByTaskIDs(s, taskIDs)
|
||||
if err != nil {
|
||||
log.Errorf("[Undone Overdue Tasks Reminder] Could not get projects for tasks: %s", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user