~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/state/clock.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2015 Canonical Ltd.
2
 
// Licensed under the AGPLv3, see LICENCE file for details.
3
 
 
4
 
package state
5
 
 
6
 
import (
7
 
        "github.com/juju/utils/clock"
8
 
)
9
 
 
10
 
// GetClock exists to allow us to patch out time-handling; specifically
11
 
// for the worker/uniter tests that want to know what happens when leases
12
 
// expire unexpectedly.
13
 
//
14
 
// TODO(fwereade): lp:1479653
15
 
// This is *clearly* a bad idea, and we should be injecting the dependency
16
 
// explicitly -- and using an injected clock across the codebase -- but,
17
 
// time pressure.
18
 
var GetClock = func() clock.Clock {
19
 
        return clock.WallClock
20
 
}