removed the defer idiom for storing audit records; it's not necessary, because AmStoreAudit just pushes the audit record to the writer goroutine anyway

This commit is contained in:
2026-02-21 18:24:29 -07:00
parent 5acb67106c
commit f48d97868d
5 changed files with 45 additions and 125 deletions
+1 -5
View File
@@ -1214,10 +1214,6 @@ func AmCreateConference(ctx context.Context, comm *Community, name, alias, descr
newConf.CreateLevel = AmDefaultRole("Conference.Create.Public").Level()
}
var ar *AuditRecord = nil
defer func() {
AmStoreAudit(ar)
}()
success := false
tx := amdb.MustBegin()
defer func() {
@@ -1290,6 +1286,6 @@ func AmCreateConference(ctx context.Context, comm *Community, name, alias, descr
// Add the new conference to the cache, and create our audit record.
conferenceCache.Add(rc[0].ConfId, &(rc[0]))
ar = AmNewCommAudit(AuditConferenceCreate, u.Uid, comm.Id, ipaddr, fmt.Sprintf("confid=%d", rc[0].ConfId), fmt.Sprintf("name=%s", name), fmt.Sprintf("alias=%s", alias))
AmStoreAudit(AmNewCommAudit(AuditConferenceCreate, u.Uid, comm.Id, ipaddr, fmt.Sprintf("confid=%d", rc[0].ConfId), fmt.Sprintf("name=%s", name), fmt.Sprintf("alias=%s", alias)))
return &(rc[0]), nil
}