github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/setting/deployment.go (about)

     1  // Copyright 2023 The GitBundle Inc. All rights reserved.
     2  // Copyright 2017 The Gitea Authors. All rights reserved.
     3  // Use of this source code is governed by a MIT-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package setting
     7  
     8  import (
     9  	"time"
    10  
    11  	"github.com/gitbundle/modules/log"
    12  )
    13  
    14  var (
    15  	Deployment = struct {
    16  		DebugRunningDuration  time.Duration
    17  		VerifyRunningDuration time.Duration
    18  		Disable               bool
    19  	}{}
    20  )
    21  
    22  func newDeploymentService() {
    23  	sec := Cfg.Section("deployment")
    24  	if err := sec.MapTo(&Deployment); err != nil {
    25  		log.Fatal("Failed to map nsq settings: %v", err)
    26  	}
    27  
    28  	Deployment.DebugRunningDuration = sec.Key("DEBUG_RUNNING_DURATION").MustDuration(7 * 24 * time.Hour)
    29  	Deployment.VerifyRunningDuration = sec.Key("VERIFY_RUNNING_DURATION").MustDuration(10 * time.Minute)
    30  }