Release lock before sending on a channel

This commit is contained in:
Bryan Boreham committed 2015-06-16 11:44:25 +01:00
1 parent 0206434f62
commit 7a106aeb5f
1 file changed
+2 -3
+2 -3
View File
@@ -235,12 +235,11 @@ func (zone *ZoneDb) DomainLookupInaddr(inaddr string) (res []ZoneRecord, err err
func (zone *ZoneDb) startUpdatingName(name string) {
if zone.refreshInterval > 0 {
zone.mx.Lock()
defer zone.mx.Unlock()
// check if we should enqueue a refresh request for this name
n := zone.getNameSet(defaultRemoteIdent).getName(name, true)
now := zone.clock.Now()
zone.mx.Unlock() // Don't hold the lock while talking to the SchedQueue
if n.lastRefreshTime.IsZero() {
now := zone.clock.Now()
n.lastRefreshTime = now
Debug.Printf("[zonedb] Creating new immediate refresh request for '%s'", name)