github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/worker/resumer/export_test.go (about)

     1  // Copyright 2012, 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package resumer
     5  
     6  import (
     7  	"sync"
     8  	"time"
     9  )
    10  
    11  var mu sync.Mutex
    12  
    13  func SetInterval(i time.Duration) {
    14  	mu.Lock()
    15  	defer mu.Unlock()
    16  
    17  	interval = i
    18  }
    19  
    20  func RestoreInterval() {
    21  	mu.Lock()
    22  	defer mu.Unlock()
    23  
    24  	interval = defaultInterval
    25  }