feat(t206): connect Android procurement tasks
This commit is contained in:
@@ -23,7 +23,7 @@ const (
|
||||
defaultDatabasePath = "var/cmroubao.db"
|
||||
defaultAssetDirectory = "var/assets"
|
||||
defaultClaimLease = 10 * time.Minute
|
||||
defaultRunningLease = 90 * time.Second
|
||||
defaultRunningLease = 30 * time.Minute
|
||||
defaultReadinessTTL = 2 * time.Minute
|
||||
)
|
||||
|
||||
@@ -121,8 +121,8 @@ func Load(lookup LookupEnvironment) (Config, error) {
|
||||
lookup,
|
||||
RunningLeaseEnvironment,
|
||||
defaultRunningLease,
|
||||
30*time.Second,
|
||||
10*time.Minute,
|
||||
5*time.Minute,
|
||||
120*time.Minute,
|
||||
)
|
||||
if err != nil {
|
||||
return Config{}, err
|
||||
|
||||
@@ -30,7 +30,7 @@ func TestLoadUsesSafeDefaults(t *testing.T) {
|
||||
t.Fatal("server safety limits must all be positive")
|
||||
}
|
||||
if cfg.ClaimLease != 10*time.Minute ||
|
||||
cfg.RunningLease != 90*time.Second ||
|
||||
cfg.RunningLease != 30*time.Minute ||
|
||||
cfg.ReadinessTTL != 2*time.Minute {
|
||||
t.Fatalf(
|
||||
"lifecycle durations = %s / %s / %s",
|
||||
@@ -52,7 +52,7 @@ func TestLoadAcceptsExplicitConfiguration(t *testing.T) {
|
||||
TLSCertificateEnvironment: "tmp/server.crt",
|
||||
TLSPrivateKeyEnvironment: "tmp/server.key",
|
||||
ClaimLeaseEnvironment: "15m",
|
||||
RunningLeaseEnvironment: "2m",
|
||||
RunningLeaseEnvironment: "45m",
|
||||
ReadinessTTLEnvironment: "3m",
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestLoadAcceptsExplicitConfiguration(t *testing.T) {
|
||||
)
|
||||
}
|
||||
if cfg.ClaimLease != 15*time.Minute ||
|
||||
cfg.RunningLease != 2*time.Minute ||
|
||||
cfg.RunningLease != 45*time.Minute ||
|
||||
cfg.ReadinessTTL != 3*time.Minute {
|
||||
t.Fatalf(
|
||||
"lifecycle durations = %s / %s / %s",
|
||||
@@ -174,10 +174,16 @@ func TestLoadRejectsUnsafeOrInvalidValues(t *testing.T) {
|
||||
ClaimLeaseEnvironment: "59s",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "running lease below minimum",
|
||||
values: map[string]string{
|
||||
RunningLeaseEnvironment: "4m59s",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "running lease above maximum",
|
||||
values: map[string]string{
|
||||
RunningLeaseEnvironment: "11m",
|
||||
RunningLeaseEnvironment: "121m",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user