diff --git a/modules/appstate/item_runtime.go b/modules/appstate/item_runtime.go index fd2ecb80ac8af..7fdc53f64247a 100644 --- a/modules/appstate/item_runtime.go +++ b/modules/appstate/item_runtime.go @@ -6,8 +6,7 @@ package appstate // RuntimeState contains app state for runtime, and we can save remote version for update checker here in future type RuntimeState struct { - LastAppPath string `json:"last_app_path"` - LastCustomConf string `json:"last_custom_conf"` + LastAppPath string `json:"last_app_path"` } // Name returns the item name diff --git a/routers/init.go b/routers/init.go index a127e00e5a119..e640ca48453bc 100644 --- a/routers/init.go +++ b/routers/init.go @@ -74,31 +74,21 @@ func InitGitServices() { mustInit(repo_service.Init) } -func syncAppConfForGit(ctx context.Context) error { +func syncAppPathForGit(ctx context.Context) error { runtimeState := new(appstate.RuntimeState) if err := appstate.AppState.Get(runtimeState); err != nil { return err } - - updated := false if runtimeState.LastAppPath != setting.AppPath { log.Info("AppPath changed from '%s' to '%s'", runtimeState.LastAppPath, setting.AppPath) - runtimeState.LastAppPath = setting.AppPath - updated = true - } - if runtimeState.LastCustomConf != setting.CustomConf { - log.Info("CustomConf changed from '%s' to '%s'", runtimeState.LastCustomConf, setting.CustomConf) - runtimeState.LastCustomConf = setting.CustomConf - updated = true - } - if updated { log.Info("re-sync repository hooks ...") mustInitCtx(ctx, repo_service.SyncRepositoryHooks) log.Info("re-write ssh public keys ...") mustInit(asymkey_model.RewriteAllPublicKeys) + runtimeState.LastAppPath = setting.AppPath return appstate.AppState.Set(runtimeState) } return nil @@ -163,7 +153,7 @@ func GlobalInitInstalled(ctx context.Context) { mustInit(repo_migrations.Init) eventsource.GetManager().Init() - mustInitCtx(ctx, syncAppConfForGit) + mustInitCtx(ctx, syncAppPathForGit) mustInit(ssh.Init)