mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 23:39:56 +01:00
fix(be): remove recursive call in BoltDB method
This commit is contained in:
parent
db252379c0
commit
8516e31415
@ -57,9 +57,9 @@ func (d *BoltDb) getTasks(projectID int, templateID *int, params db.RetrieveQuer
|
||||
tpl, ok := templates[task.TemplateID]
|
||||
if !ok {
|
||||
if templateID == nil {
|
||||
tpl, _ = d.GetTemplate(task.ProjectID, task.TemplateID)
|
||||
tpl, _ = d.getRawTemplate(task.ProjectID, task.TemplateID)
|
||||
} else {
|
||||
tpl, _ = d.GetTemplate(task.ProjectID, *templateID)
|
||||
tpl, _ = d.getRawTemplate(task.ProjectID, *templateID)
|
||||
}
|
||||
templates[task.TemplateID] = tpl
|
||||
}
|
||||
|
@ -59,8 +59,13 @@ func (d *BoltDb) GetTemplates(projectID int, filter db.TemplateFilter, params db
|
||||
return
|
||||
}
|
||||
|
||||
func (d *BoltDb) GetTemplate(projectID int, templateID int) (template db.Template, err error) {
|
||||
func (d *BoltDb) getRawTemplate(projectID int, templateID int) (template db.Template, err error) {
|
||||
err = d.getObject(projectID, db.TemplateProps, intObjectID(templateID), &template)
|
||||
return
|
||||
}
|
||||
|
||||
func (d *BoltDb) GetTemplate(projectID int, templateID int) (template db.Template, err error) {
|
||||
template, err = d.getRawTemplate(projectID, templateID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user