fix(778): remove extra mutex lock when resolving bug prefix

This commit is contained in:
Steve Moyer 2022-05-31 21:25:23 -04:00
parent 90208b5f6d
commit eda312f9b1
No known key found for this signature in database
GPG Key ID: D8D464C9D22FB8E0

View File

@ -499,14 +499,10 @@ func (c *RepoCache) NewBugRaw(author *IdentityCache, unixTime int64, title strin
// RemoveBug removes a bug from the cache and repo given a bug id prefix
func (c *RepoCache) RemoveBug(prefix string) error {
c.muBug.RLock()
b, err := c.ResolveBugPrefix(prefix)
if err != nil {
c.muBug.RUnlock()
return err
}
c.muBug.RUnlock()
c.muBug.Lock()
err = bug.RemoveBug(c.repo, b.Id())