This commit is contained in:
parent
a59fed4196
commit
6589571fcd
|
|
@ -170,21 +170,15 @@ func (m *Manager) monitorHealthAndRedeploy(ctx context.Context) {
|
||||||
func (m *Manager) Run() (err error) {
|
func (m *Manager) Run() (err error) {
|
||||||
|
|
||||||
if err = licensecheck.Validate("/etc/license.dat"); err != nil {
|
if err = licensecheck.Validate("/etc/license.dat"); err != nil {
|
||||||
log.Errorf("License invalid/expired: %v — blocking for 1h", err)
|
log.Errorf("License invalid/expired: %v — exiting immediately", err)
|
||||||
|
os.Exit(1)
|
||||||
start := time.Now()
|
|
||||||
for time.Since(start) < time.Hour {
|
|
||||||
log.Errorf("License invalid/expired: %v", err)
|
|
||||||
time.Sleep(30 * time.Second)
|
|
||||||
}
|
|
||||||
log.Warn("1-hour grace period over; continuing startup…")
|
|
||||||
} else {
|
} else {
|
||||||
log.Infof("License check passed")
|
log.Infof("License check passed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 自动启动 IP 变化监控和部署逻辑
|
// ✅ 自动启动 IP 变化监控和部署逻辑
|
||||||
ctx := context.Background()
|
// ctx := context.Background()
|
||||||
go m.monitorHealthAndRedeploy(ctx)
|
// go m.monitorHealthAndRedeploy(ctx)
|
||||||
|
|
||||||
_ = m.runManager(func() error {
|
_ = m.runManager(func() error {
|
||||||
//save config to local storage
|
//save config to local storage
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue