~nskaggs/+junk/xenial-test

« back to all changes in this revision

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

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

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
}